rails 3.1: how override inherited_resources and permit rails scaffolding to work normally again?

ぐ巨炮叔叔 提交于 2019-12-30 02:17:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!