This project is archived and is in readonly mode.
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
-
CancelProfileIsBroken August 5th, 2009 @ 02:08 PM
- Tag changed from 2.3-rc1, 2.x, asset_tag_helper to 2.3-rc1, 2.x, asset_tag_helper, bugmash
-
Rajesh August 9th, 2009 @ 08:13 PM
-1 rewrite_asset_path is a private function, its not an option. If someone overrides a private function, they should not expect to change the behavior of other private function.
Also the rewrite_asset_path can be overriden in multiple ways, I cannot think of a generic comment here.
-
Jeremy Kemper August 9th, 2009 @ 08:33 PM
- State changed from new to wontfix
-
CancelProfileIsBroken August 9th, 2009 @ 10:05 PM
- Tag changed from 2.3-rc1, 2.x, asset_tag_helper, bugmash to 2.3-rc1, 2.x, asset_tag_helper
- Milestone cleared.
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="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>