Skip to content

Instantly share code, notes, and snippets.

@rcdexta
Created December 4, 2014 11:07
Show Gist options
  • Save rcdexta/f15e8b190dffad0a1c59 to your computer and use it in GitHub Desktop.
Save rcdexta/f15e8b190dffad0a1c59 to your computer and use it in GitHub Desktop.
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