Domanda

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.

È stato utile?

Soluzione

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'

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top