首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >儿童引用的toplevel常数ApplicationController::ApplicationController

儿童引用的toplevel常数ApplicationController::ApplicationController
EN

Stack Overflow用户
提问于 2012-01-31 19:43:47
回答 1查看 663关注 0票数 0

我要合并两个申请学校和孩子。在学校应用程序中嵌套的每个孩子应用程序都很好。他们每个人都有自己的数据库。以下是学校应用程序树的一部分:

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命名空间不工作吗?

EN

回答 1

Stack Overflow用户

发布于 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

这是一个名称冲突,即使它们来自两个不同的名称空间!从这里找到一些提示,希望能有所帮助

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9085845

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档