Saturday, 24 August 2013

Rails 4 not adding fingerprint to included "extra" Asset Pipeline manifest files on Heroku

Rails 4 not adding fingerprint to included "extra" Asset Pipeline manifest
files on Heroku

I have a few extra manifest files in my app defined in
config/environments/production.rb like so:
config.assets.precompile += %w( www.js sessions.js embed.js www.css
sessions.css embed.css )
These work fine locally in development mode, but in my custom Heroku
staging environment, the style_sheet_link_tag and javascript_include_tag
helpers don't add a fingerprint to the combined files, causing these
assets to return a 404 error.
Here is an example of what's generated by style_sheet_link_tag for www.css:
<%# Look ma, no fingerprint! %>
<link href="//s3.amazonaws.com/my-bucket-name/stylesheets/www.css"
media="all" rel="stylesheet" />
Here is the file at app/assets/stylesheets/www/index.css:
/*
*= require_self
*= require www/foundation_and_overrides
*= require mediaelement_rails
*= require mediaelement_rails/mejs-skins
*= require www/base
*= require www/icons
*= require www/header
*= require www/footer
*= require www/home
*= require www/help
*/
This behaves correctly in Rails 3.2.14, but not after upgrading to Rails
4.0.0. So what do I have to do differently to make it work?

No comments:

Post a Comment