Rails 3.1 Use an image without fingerprint hash

2019-05-22 23:13发布

问题:

I have solved a few of my asset pipeline woes, but one of them remains. I have a couple of image_tags, and I want them to refer to the non-fingerprinted/hashed/digested version. Is there a way to force an image_tag (but only one or two, not application-wide) to use the non-digested version of the image?

回答1:

Take a look at fingerprintless, that should do it.



回答2:

Use :digest => false as an option to asset_path within image_tag

<%= image_tag(asset_path("filename.png", :digest => false)) %>