Search code examples
ruby-on-rails-3activescaffoldinherited-resources

How to override inherited_resources with the rails scaffold command


I am using the active_admin gem in my Rails 3 application, which has as a dependency inherited_resources. I am somewhat of a newb and would rather avoid the black box qualities of inherited_resources for my own controllers, however, when I run the default rails g scaffold command, the controllers that are generated are inheriting from inherited_resources. I know that I can manually override this by inheriting from ApplicationController, however, I would like to be able to generate the default rails scaffolds if possible.


Solution

  • -c=scaffold_controller

    or add this to config/application.rb

    config.generators do |g|
      g.scaffold_controller "scaffold_controller"
    end