Monday, October 18, 2010

Rails 3 scaffold generator defaults

The following command prints the scaffold genarator help

$ rails g scaffold --help

to set some defaults, you can add the following in config/application.rb:

    config.generators do |g|
      g.test_framework :rspec, :fixture => true
      g.controller_specs false
      g.view_specs false
    end

calling "rails g scaffold --help" again shows the applied defaults

ralated links:
http://railscasts.com/episodes/216-generators-in-rails-3

http://railscasts.com/episodes/218-making-generators-in-rails-3

No comments: