Skip to content

Instantly share code, notes, and snippets.

@zporter
Created September 27, 2012 00:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zporter/3791539 to your computer and use it in GitHub Desktop.
Save zporter/3791539 to your computer and use it in GitHub Desktop.
OfficeGames Root Path Constraint
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