Created
December 4, 2014 11:07
-
-
Save rcdexta/f15e8b190dffad0a1c59 to your computer and use it in GitHub Desktop.
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 ApplicationController < ActionController::Base | |
before_filter :check_user_session, except: [:logout] | |
def check_user_session | |
unless valid_user? | |
request.xhr? ? ajax_redirect_to(login_path) : redirect_to login_path | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment