I have a nested resource in my routes.rb
like this:
map.resources :users, :only => [:index] do |user|
user.resources :projects
end
which gives me URLs like /users/2/projects
, which will show all projects owned by user
2. After a user is signed in, I'd like this to be the root page, using map.root
. How would I set map.root
to enable this? I'm using devise, so I can get the current user with current_user
, but I'm not sure this is available in routes.rb
.