Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Authenticated Route Constraints #1147
Allows routing based on authentication state, optionally by scope.
The example included in the comments for #authenticated:
authenticated :admin do root :to => 'admin/dashboard#show' end authenticated do root :to => 'dashboard#show' end root :to => 'landing#show'
With authenticated I can provide the same path twice but route differently based on authentication state. A classic example is github itself. Unauthenticated users see a landing page extorting github's virtue, authenticated users see a dashboard of recent activity and repositories, both at the root URL.
added a commit
this pull request
Jun 23, 2011
My proposed syntax for it would be:
(Unless there is already a way of doing the same from the controller that I am not aware of.)