How do I turn off automatic stylesheet/javascript generation on Rails 3.1?

An update on @Dmitry Maksimov's answer for Rails 4.2. You can disable generation of controller-specific asset files by default with the following in your config/application.rb file (source: the guide):

config.generators do |g|
  g.assets false
end

New syntax is rails generate controller Resources --no-assets.

Don't forget you can also use g in place of generate. And you can skip the creation of a controller helper using the --no-helper flag.


Add these lines to application.rb:

config.generators.stylesheets = false
config.generators.javascripts = false

For just one time, use:

rails generate controller controller_name --no-assets