This project is archived and is in readonly mode.

#4247 ✓resolved
Craig Webster

Add magic encoding comment to generated files

Reported by Craig Webster | March 21st, 2010 @ 08:16 PM

This patch allows you to set the way that asset paths are rewritten. My own use case was to accommodate a server setup where not all of the assets have the same mtime even if they're the same file.

If this is not set then it falls back to the default of using ENV['RAILS_ASSET_ID'] or the file mtime.

# config/environments/production.rb
# Normally you'd calculate RELEASE_NUMBER at startup.
RELEASE_NUMBER = 12345
config.action_controller.asset_path_template = proc { |asset_path|
  "/release-#{RELEASE_NUMBER}#{asset_path}"
}

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="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages