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
.
We're solving this with a HomepageController that renders two different templates based on if current_user
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With