我要合并两个申请学校和孩子。在学校应用程序中嵌套的每个孩子应用程序都很好。他们每个人都有自己的数据库。以下是学校应用程序树的一部分:
app/controllers/application_controller.rbapp/controllers/user.rb ... app/controllers/children/application_controller.rbapp/controllers/children/user.rb ...
并发出了以下警告:
由儿童引用的toplevel常量ApplicationController::ApplicationControllertoplevel常量用户
在app/controllers/children/application_controller.rb我有
类子::ApplicationController< ActionController::Base
在应用程序/控制器/应用程序_控制器. in中
类ApplicationController < ActionController::Base
嵌套的ApplicationController不是loaded.the命名空间不工作吗?
发布于 2012-03-26 20:44:21
1-
toplevel constant ApplicationController referenced by Children::ApplicationController
最后,我将两个applicationController合并到一个applicationController中,即在学校applicationController中添加嵌套applicatioController ( applicationController )的内容,使其只有一个applicationController。
2-
toplevel constant User referenced by Children::User
我将改名为users_controller.rb,改为children_users_controller.rb。在控制器中有第一行
class Children::ChildrenUsersController < Children::ApplicationController
这是一个名称冲突,即使它们来自两个不同的名称空间!从这里找到一些提示,希望能有所帮助
https://stackoverflow.com/questions/9085845
复制相似问题