How to create a dynamic root in Rails 3?

Viewed 3771

I have admins and normal users in my webapp. I want to make their root (/) different depending on who they are. The root is accessed from many different pages, so it would be much easier if I could make this happen in the routes.rb file. Here is my current file.

ProjectManager::Application.routes.draw do
  root :to => "projects#index"
end

Can someone please link me to an example that can show me the direction to go in? Is there any way to put logic into the routes file? Thanks for all the help.

3 Answers
Related