Skip to content

Instantly share code, notes, and snippets.

@coderhs
Created October 26, 2012 15:24
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/3959411 to your computer and use it in GitHub Desktop.
Save coderhs/3959411 to your computer and use it in GitHub Desktop.
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