So we have a small problem with asset pipeline digests in that we have a number of HTML templates as assets (for AngularJS) and we references the paths for these assets in a Javascript file with the asset_path
helper. Unfortunately because of how the asset precompile step (and Heroku) check for changes, making changes to a template does not cause the javascript file to be recompiled.
So basically in a file like application.coffee.erb
we might have something like:
url = '<%= asset_path('views/template.html') %>'
And when we run rake assets:precompile
that will get turned into /assets/views/template-1023911231.html
which has a digest value but if template.html.slim
is changed the digest will change but since application.coffee.erb
has not fundamentally changed it isn't recompiled and continues to point to the old digest.
Thoughts? Solutions? This seems like a bug to me actually.
Update
Currently the best solution I have is to update the asset version in application.rb if we need to change our HTML template assets but none of the javascript has changed.