我安装我的路由到命名空间,所以它看起来像路由或轨道错误?
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尝试获得home
控制器users
命名空间提前
你可以运行'bundle exec rake routes | grep root'在生产中? –