新手问题 Rails 如何禁用 Assets Pipline

kitt · May 13, 2013 · Last by yan32768 replied at May 13, 2013 · 2584 hits

assets 中的 js,css 特性用着不喜欢,如何禁用他呢,还是习惯在 public 中放着些文件

我也想用,每次编译好麻烦,并且不知道为什末,在 development 环境下,也需要编译才管用

In Rails 3.1, 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

You can also disable the asset pipeline while creating a new application by passing the —skip-sprockets option.

rails new appname --skip-sprockets

You should use the defaults for all new applications unless you have a specific reason to avoid the asset pipeline 这应该是答案吧。来自 http://guides.rubyonrails.org/asset_pipeline.html

You need to Sign in before reply, if you don't have an account, please Sign up first.