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.
Rails scaffolding is a quick way to generate some of the major pieces of an application. If you want to create the models, views, and controllers for a new resource in a single operation, scaffolding is the tool for the job.
You can remove scaffold in the following way: Generate scaffold: $rails generate scaffold Story. If you migrated your files, perform a rollback: $rake db:rollback. Destroy or undo scaffold: $rails destroy scaffold Story.
-c=scaffold_controller
or add this to config/application.rb
config.generators do |g|
g.scaffold_controller "scaffold_controller"
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With