I\'m working on a project management app, and in the app, I have project_managers and clients. I\'m using Devise and CanCan for authenticat
Another option is to pass a proc to the authenticated
method like this (I'm using rolify in this example):
authenticated :user, ->(u) { u.has_role?(:manager) } do
root to: "managers#index", as: :manager_root
end
authenticated :user, ->(u) { u.has_role?(:employee) } do
root to: "employees#index", as: :employee_root
end
root to: "landing_page#index"
Note that in Rails 4 you have to specify a unique name for each root route, see this issue for details.