Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I've got a Rails 3.1 project that I'm working on, but I don't want controller_name.css.sass and controller_name.js.coffee to be generated each time I run rails generate controller controller_name. I could swear I've seen the setting somewhere on the internet, but I can't find it now for the life of me. What is it?

Keep in mind that I'm still wanting to use the Asset Pipeline and the CoffeeScript/Sass integration, but I'm organizing those files in my own way.

I'm pretty sure the answer is a command line argument, but bonus points for turning it off with a generator setting or a hidden file or something.

EDIT: I've found the command line flag for it.

rails generate controller controller_name --assets=false 

Or something of the like (that line actually errors out, but it also doesn't generate the assets). The API here shows :assets => true as a default option. How do I change that to false and have it always be false every time I generate a controller?

like image 794
Ben Kreeger Avatar asked Sep 09 '11 19:09

Ben Kreeger


1 Answers

Add these lines to application.rb:

config.generators.stylesheets = false config.generators.javascripts = false 
like image 101
Dmitry Maksimov Avatar answered Oct 06 '22 12:10

Dmitry Maksimov