class ActionDispatch::Routing::Mapper
def authenticated(scope = nil, block = nil)
root to: 'landing#show'
end
root to: "admin/dashboard#show", as: :user_root
authenticated :user, lambda {|u| u.role == "admin"} do
end
root to: 'dashboard#show', as: :authenticated_root
authenticated do
end
root to: 'admin/dashboard#show', as: :admin_root
authenticated :admin do
a model and allows extra constraints to be done on the instance.
can optionally specify which scope and a block. The block accepts
Allow you to route based on whether a scope is authenticated. You
def authenticated(scope = nil, block = nil) constraints_for(:authenticate?, scope, block) do yield end end