Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails: don't generate helpers

I know this is simple but I don't remember how to do this and wasn't able to find it on Google...

I rarely need a controller-specific helper file, so I would prefer that when I generate a Controller the helper (and helper spec) not be generated along with it.

I tried

#application.rb
config.generators do |g|
  g.helpers false
end

...but that didn't work. How do you change that?

like image 375
Andrew Avatar asked Nov 11 '11 02:11

Andrew


People also ask

What does rails generate resource do?

Rails Generate Resource You enter the name of the resource you want to create along with the table column names and types. You can even assign foreign keys in this line of code so that you save time. Generating a resource does everything generating a model does, but it also creates a resource in the routes.


1 Answers

You are close, according to http://blog.plataformatec.com.br/2011/02/understanding-the-latest-rails-benchmarks/

config.generators.helper = false
like image 93
Shaun Wilde Avatar answered Oct 27 '22 01:10

Shaun Wilde