开发者

Passing a default parameters for "rails generate" command

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜