Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Overriding rewrite_asset_path also requires overriding asset_file_path

#2074

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.

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

State: wontfix
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from 2.3-rc1, 2.x, asset_tag_helper to 2.3-rc1, 2.x, asset_tag_helper, bugmash

    August 5th, 2009 @ 02:08 PM

  2. Rajesh
    Rajesh

    -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.

    August 9th, 2009 @ 08:13 PM

  3. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to wontfix

    August 9th, 2009 @ 08:33 PM

  4. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from 2.3-rc1, 2.x, asset_tag_helper, bugmash to 2.3-rc1, 2.x, asset_tag_helper
    • Milestone cleared.

    August 9th, 2009 @ 10:05 PM

  5. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 9th, 2010 @ 10:04 PM

  6. Jeff Kreeftmeijer
  7. bingbing