-
-
Save sahidursuman/82a7fe05c73b39f031583d6f0c355048 to your computer and use it in GitHub Desktop.
OfficeGames Root Path Constraint
This file contains hidden or 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