开发者

Is there standard Rails mechanism to concat all javascript files into public/javascripts/cache/all.js?

开发者 https://www.devze.com 2023-01-21 22:34 出处:网络
If the file public/j开发者_C百科avascripts/cache/all.js is removed, and then a webpage is fetched from the rails server, then that all.js file

If the file public/j开发者_C百科avascripts/cache/all.js is removed, and then a webpage is fetched from the rails server, then that all.js file magically reappears in the file system, with a timestamp that is half an hour ago. Is there actually Rails mechanism that regenerates this file or what might be regenerating this file?


Most probably you're using javascript_include_tag :all, :cache => true somewhere in your layout. This will bundle all of your javascripts into all.js. You can also use :recursive => true to include subdirectories.

See http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-javascript_include_tag

0

精彩评论

暂无评论...
验证码 换一张
取 消