我安裝我的路由到命名空間,所以它看起來像路由或軌道錯誤?
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'在生產中? –