In a Rails 3.2 app I have two user models set up using Devise: Admin and User.
I have an Admin-specific root page defined in my routes file.
namespace :admin do
root :to => "pages#welcome"
end
I have also seen this written as
authenticated :user do
root :to => 'pages#welcome'
end
I have not been able to find a clear description of the difference between using namespace and authenticated, and what implications this may have for security.
I’d be very grateful if someone could enlighten me, or point me towards a clear description.
Thanks!
/admin and it will route to pages#welcome
I use it to create a root_path that’s a dashboard for a logged in user, but the marketing pages#welcome for non logged in: