Every time I use an asset tag helper, there is a parameter appended to the end of my file name. e.g. <input src="/images/search.gif?1213816620" type="image" /> From what I am reading, this appears to be a timestamp for caching purposes. It works in most cases, but I want to use image_path to embed a flash file. .swf file in public/images/flash e.g. <object>..... <param name="movie" value="<%= image_path(''flash/front_page_banner.swf'') %>" /> ....</object> This outputs the proper path, but appends the timestamp and the flash plugin will not display the file. Take the parameter off and it works fine. In production, the app will be deployed in a subdirectory, so the path will be different. Is there a different asset tag helper or approach I should be using? Thanks, Cory -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> Every time I use an asset tag helper, there is a parameter appended to > the end of my file name. > > e.g. <input src="/images/search.gif?1213816620" type="image" /> > > From what I am reading, this appears to be a timestamp for caching > purposes. It works in most cases, but I want to use image_path to > embed > a flash file. > > .swf file in public/images/flash > > e.g. > <object>..... > <param name="movie" value="<%= image_path(''flash/ > front_page_banner.swf'') > %>" /> > ....</object> > > This outputs the proper path, but appends the timestamp and the flash > plugin will not display the file. Take the parameter off and it works > fine. > > In production, the app will be deployed in a subdirectory, so the path > will be different. > > Is there a different asset tag helper or approach I should be using?You could roll your own, or look at aliasing rewrite_asset_path to not append the timestamp if the source matches ".swf". Or modify rails_asset_id(). I think you can also disable it completely, but I forgot how at the moment. In vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb # Break out the asset path rewrite in case plugins wish to put the asset id # someplace other than the query string. def rewrite_asset_path(source) asset_id = rails_asset_id(source) if asset_id.blank? source else source + "?#{asset_id}" end end --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, To disable asset_id completely, simply set the environment variable (for instance in environment.rb): ENV[''RAILS_ASSET_ID''] = "" cheers Philip Hallstrom wrote:>> .swf file in public/images/flash >> fine. >> >> In production, the app will be deployed in a subdirectory, so the path >> will be different. >> >> Is there a different asset tag helper or approach I should be using? > > You could roll your own, or look at aliasing rewrite_asset_path to not > append the timestamp if the source matches ".swf". Or modify > rails_asset_id(). I think you can also disable it completely, but I > forgot how at the moment. > > In vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb > > # Break out the asset path rewrite in case plugins wish to > put the asset id > # someplace other than the query string. > def rewrite_asset_path(source) > asset_id = rails_asset_id(source) > if asset_id.blank? > source > else > source + "?#{asset_id}" > end > end-- Posted via http://www.ruby-forum.com/.