disable assets precompile function in Rails

蓝咒 提交于 2019-12-06 02:01:27

问题


I would like to disable assets precompile function in rails. I am working on app where user can download the code, and I would like to avoid changeing the names of the css and js files in downloaded html file - so as the user can run the index.html and see everything.

Here is the app: http://impress-builder.herokuapp.com/


回答1:


Take a look at The Assets Pipeline Guide.

The asset pipeline is enabled by default. It can be disabled in config/application.rb by putting this line inside the application class definition:

config.assets.enabled = false



回答2:


Alternative Approach

config.assets.precompile

Is an array of files to be compiled. Swap it with an empty array to avoid precompilation.

# config/application.rb
# ...
config.assets.precompile = []
# ...


来源:https://stackoverflow.com/questions/18935784/disable-assets-precompile-function-in-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!