Skip to content

Instantly share code, notes, and snippets.

Created March 19, 2012 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/2086498 to your computer and use it in GitHub Desktop.
Save anonymous/2086498 to your computer and use it in GitHub Desktop.
Rails Constraints with Warden
authenticated do
root :to => 'teachers/dashboards#show', :constraints => lambda{ |req| req.session['warden.user.user.key'][0] == 'Teacher' }
root :to => 'students/dashboards#show', :constraints => lambda{ |req| req.session['warden.user.user.key'][0] == 'Student' }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment