Question

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.

Was it helpful?

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'

OTHER TIPS

Everything in any of the asset paths (app/assets, vendor/assets, any gems or engines) end up as /assets/<resource path> eventually. So in your case the path would be /assets/zClip/zclip.swf

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top