Search code examples
jqueryruby-on-railszclip

whats the path of a file inside vendor assets


this might be an easy one. Im using a plug in to copy text to my clipboard (zclip) that requires me to add a .swf file to my assets.

I added a folder under my vendor>assets>zClip> zclip.swf

then on my javascript it requires that I add the path. what path should I use?

    $("#copy-button").zclip({
        path: "",
        copy:$('.copy_tag').text()
    });

thank you so much.


Solution

  • First of all check that the path is being included by running Rails.application.config.assets.paths in a console. If you see it, try putting <%= asset_path 'zclip.swf' %> in one of your views. It'll probably just be 'assets/zclip.swf'