Ruby on rails 3.1 控制器继承的资源::基本

Ruby on rails 3.1 控制器继承的资源::基本,ruby-on-rails-3.1,Ruby On Rails 3.1,我在栏杆上搭脚手架,而不是一般的 class UtilLegalsController < ApplicationController class-UtilLegalsController

我在栏杆上搭脚手架,而不是一般的

class UtilLegalsController < ApplicationController
class-UtilLegalsController
我得到

类UtilLegalsController
有人知道为什么吗?有什么区别?BAU控制器的正确选项是什么?

可能您使用的是安装了gem的Rails环境。 这不是问题,一旦这个gem从ApplicationController继承,并因此扩展它的行为。
如果您需要更多信息,请将您的浏览器指向该网站,以便进行更完整的讨论。

可能是,您正在使用的gem包含gem
继承的资源(例如
活动的\u管理员
)。在这种情况下,您可以使用
-c=scaffold\u controller
选项生成脚手架:

rails g scaffold Post user:references title:string body:text -c=scaffold_controller
这将绕过继承的资源控制器

rails g scaffold Post user:references title:string body:text -c=scaffold_controller