-1
我想在用戶登錄後設置根URL,但問題出在用戶登錄後,它們被重定向到主頁但不是我想要的頁面。這是代碼。沒有路由到rails中的命名空間控制器
devise_scope :user do
authenticated :user do
# root to: 'dashboard#index', module: 'client'
namespace :client do
root to: 'dashboard#index', as: :dashboard
end
end
unauthenticated :user do
root to: 'devise/registrations#new', as: :unauthenticated_root
end
end
用戶應該被重定向到/ client/index,而不是被重定向到\。
設計已經與after_sign_in_path_for方法處理這一點。只需在你的控制器中覆蓋該方法(大概是ApplicationController),並讓它返回你想要的任何路徑。 –
@TomL,是的,我現在已經做到了 – Raaz