【发布时间】:2012-05-22 21:42:04
【问题描述】:
我已经将路由设置到命名空间中,所以它看起来像
root to: "home#index"
namespace :users do
root to: "profile#index"
resources :registrations
resources :sessions
end
namespace :admin do
root to: "base#index"
end
rake routes |grep root
root / home#index
admin_root /admin(.:format) admin/base#index
users_root /users(.:format) users/profile#index
在我的标题导航中,我有= link_to "home", root_path
在开发模式下一切正常,但在生产中完全崩溃
我在尝试访问会话/注册控制器(用户/会话/新)时收到 No route matches {:controller=>"users/home"}
我标头中的 root_path 尝试在 users 命名空间中获取 home 控制器
提前致谢
【问题讨论】:
-
你能运行`bundle exec rake routes | grep root' 在生产中?
标签: ruby-on-rails routes dev-to-production