Skip to content

Instantly share code, notes, and snippets.

@coderhs
Created October 26, 2012 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coderhs/3958710 to your computer and use it in GitHub Desktop.
Save coderhs/3958710 to your computer and use it in GitHub Desktop.
an example way to redirect for different user_levels
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