This project is archived and is in readonly mode.

#2074 ✓wontfix
Walter Smith

Overriding rewrite_asset_path also requires overriding asset_file_path

Reported by Walter Smith | February 25th, 2009 @ 08:38 PM

In ActionView::Helpers::AssetTagHelper, rewrite_asset_path has the following comment:

# Break out the asset path rewrite in case plugins wish to put the asset id
# someplace other than the query string.

Unfortunately, if you actually do this, CSS and JS caching break. The asset_file_path method assumes that it should strip off the querystring to get the real file path. So it's necessary to override asset_file_path to do the opposite of whatever you made rewrite_asset_path do.

At the least this should be mentioned in the rewrite_asset_path comment. It would be better to untangle the asset tagging code that is generating URLs to appear in tags from the caching code that needs real file paths.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>