I am deploying a Rails 4.0 application that includes partial HTML templates as assets for our javascript front-end infrastructure. Although these templates are part of the asset pipeline and properly precompiled when I call asset_path from the built-in ruby ββin our js files, it returns the path to our templates without a fingerprint.
I am quite sure that this is a question exclusively for Asset Pipeline, but in order to give you a complete picture of our technical stack: we use Rails 4.0, Ruby 2.1, AngularJS for our front-end MVC structure and AssetSync to synchronize our resources between Rails and our CDN.
An example of where this happens (in the file included in app/assets/application.js.erb :
$routeProvider .when('/', { templateUrl: "<%= asset_path 'home.html' %>", controller: "HomeController" });
This works fine in place, but as soon as config.assets.digest = true during production, the asset_path call asset_path not affect the fingerprint. The templates are located in the app/assets directory in the new templates subdirectory. So, in the above example, the home.html resource is in app/assets/templates/home.html . Our javascript itself was precompiled at this point, so I think it might be a problem of what order of assets is precompiled.
I noticed a few problems in Rails Github ( 1 , 2 , 3 ) and a few SO messages saying that fingerprints are not installed properly ( 1 , 2 ), but cannot find anything that they don't turn on at all ...
Any help or ideas you can provide would be greatly appreciated.
Edit 4/15 : forgot to include that extensions in the javascript file of my application include .erb ( app/assets/application.js.erb ). Thanks Alex for that. I updated it above. In addition, following the instructions in this article about Heroku , I confirmed that running puts helper.asset_path("home.html") from the Rails console launched during production prints the correctly typed URL for this asset.