-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