Created
October 26, 2012 15:24
-
-
Save coderhs/3959411 to your computer and use it in GitHub Desktop.
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
before_filter :check_and_redirect | |
protected | |
def check_and_redirect | |
if current_user.user_level = "Admin" | |
user = 'admin' | |
landing_page = 'index' | |
else | |
user = 'user' | |
landing_page = 'index' | |
end | |
redirect_to controller: controller, action: action | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment