Rails 4 asset pipeline doesn't overwrite assets with asset_path references to other assets

前端 未结 2 1853
粉色の甜心
粉色の甜心 2021-01-03 00:52

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

2条回答
  •  自闭症患者
    2021-01-03 01:19

    A solution was suggested here which involves using the depend_on or depend_on_asset directive. In my case adding this to the .js.erb file works:

    //= depend_on_asset views/template.html
    
    url = '<%= asset_path('views/template.html') %>'
    

    This will recompile this file any time there is a change to views/template.html as desired.

提交回复
热议问题