javascript - Sprockets' asset_path is not returning the digested path of an HTML asset in production. -
i've got template html , js files in assets directory, structured this:
app - assets - templates - my_template.html - javascripts - application.js - main.js.erb
where application.js
contains standard sprockets directive: //= require main
and main.js.erb
contains reference path my_template.html
: main.js.erb
: // code here ... return { pathtotemplate: "<%= asset_path 'my_template.html' %>" } // more code here ...
in development, works great. main.js.erb
evaluated following:
// code here ... return { pathtotemplate: "assets/my_template.html" } // more code here
in production, assets precompiled (gzipped , whitespace removed), , fingerprint appended filename.
production main.js.erb
should like:
pathtotemplate: "assets/my_template-610dd79b5bb3c20d14b81baa891fc9dd.html"
but instead same in development.
does sprockets need configured fingerprint html files? perhaps it's bug, because it's generating manifest file fingerprinted paths, asset_path returning non-fingerprinted path in main.js.erb
?
thanks help.
sprockets no longer implements asset_path
- rails helper provided action view.
this question should answer rest of you:
Comments
Post a Comment