2012-01-31 37 views
0

我正在合并两个应用程序school和children。每个工作正常与儿童应用程序嵌套在学校的应用程序。他们每个人都有自己的数据库。 这里是树学校应用的一部分:顶级常量ApplicationController由Children :: ApplicationController引用

应用程序/控制器/ application_controller.rb
应用程序/控制器/ user.rb
....
应用程序/控制器/儿童/ application_controller.rb
应用程序/控制器/儿童/ user.rb ....


拥有了这些警告:


顶级恒定的ApplicationController由儿童:: ApplicationController中引用
顶级恒定的用户通过儿童引用::用户

在app /控制器/儿童/ application_controller.rb
我有
类儿童:: ApplicationController < ActionController :: Base
in app/controllers/application_controller.rb我有
class class ApplicationController < ActionController: :基地


嵌套的ApplicationController未加载。命名空间不工作?

+0

您是否曾经找到过解决方案? – 2012-03-24 20:25:42

回答

0

1-
toplevel constant ApplicationController referenced by Children::ApplicationController

我结束了在嵌套applicatioController(儿童)在校ApplicationController中的ONE的ApplicationController即添加内容,巩固双方的ApplicationController到只有一个ApplicationController的。

2-
toplevel constant User referenced by Children::User

更名的users_controller.rb到children_users_controller.rb。并且你在控制器中有第一行
class Children::ChildrenUsersController < Children::ApplicationController

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

相关问题