Created
September 27, 2012 00:55
-
-
Save zporter/3791539 to your computer and use it in GitHub Desktop.
OfficeGames Root Path Constraint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AuthConstraint | |
def matches?(request) | |
request.session['user_id'].present? | |
end | |
end | |
Officegames::Application.routes.draw do | |
constraints(AuthConstraint.new) do | |
root :to => 'games#index' | |
end | |
root :to => 'registrations#new' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment