Created
October 26, 2012 13:09
-
-
Save coderhs/3958710 to your computer and use it in GitHub Desktop.
an example way to redirect for different user_levels
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" | |
redirect_to controller: 'admin', action: 'index' | |
else | |
redirect_to controller: 'user', action: 'index' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment