There are some image assets on my site that will always remain static, and therefore do not need the timestamp that gets appended to the images. Is there a way to not append the timestamps for certain assets?
+1
A:
Why not just use the regular HTML <img>
element for those images? It'll be marginally faster than going through the Rails' helper too.
John Topley
2009-12-07 20:12:19
A:
From the Rails docs "You can enable or disable the asset tag timestamps cache. With the cache enabled, the asset tag helper methods will make fewer expense file system calls. However this prevents you from modifying any asset files while the server is running."
ActionView::Helpers::AssetTagHelper.cache_asset_timestamps = true
JosephL
2009-12-07 21:33:33
+1
A:
Solution 1 would work, except I still need it to use the asset host, and I don't want to hardcode it. Solution 2 does not work since that would affect all asset paths. I think what I should be doing is to combine using the img tag, but use rails to compute the asset host for me.
So in the end it would look something like this
<img src=\"#{@template.image_path("image.jpg}}\"/>
thanks for the idea!
Referring to Solution 1 and Solution 2 is meaningless because answers to Stack Overflow questions can be sorted differently by different users. And how about accepting some answers?
John Topley
2009-12-08 16:50:55