问题
SOLUTION FOUND: See comment
Building a new rails 3.1 app. Started with a basic blog_entries model to get the hang of it. No surprises.
Then I added ActiveAdmin, got that working okay with my existing model.
But now when I try to scaffold a new model/etc with this:
rails g scaffold Community name:string guid:string
everything seems right (views, migration) except the controller does not have CRUD options and looks like this:
class CommunitiesController < InheritedResources::Base
end
The problem is that ActiveAdmin uses inherited_resources which prevents manual rails scaffolding from working normally.
Does anyone know a way to force rails to scaffold "correctly" despite ActiveAdmin using inherited_resources?
回答1:
You can do the following to override inherited_resources
:
-c=scaffold_controller
来源:https://stackoverflow.com/questions/8919170/rails-3-1-how-override-inherited-resources-and-permit-rails-scaffolding-to-work