I'd like to pass the parameters in开发者_开发技巧 "rails generate" commands by default.
For example, I'd like to always have "-=rspec" to generate rspec files associate with the model. Also I'd like to avoid generating fixture files.
In generating controllers, I don't want a helper generated.
I thought there'd be a way to specify the default paramers somewhere in the code, probably in "config" or "script" directories.
You need define what kind of generator you want in your application.rb like that :
config.generators do |g|
g.template_engine :haml
g.test_framework :rspec
end
精彩评论