-
-
Save vitalyp/e3cb2d2d01e12ca8e16fd47ff7f23e56 to your computer and use it in GitHub Desktop.
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
class ApplicationController < ActionController::Base | |
after_filter :allow_iframe | |
protect_from_forgery with: :exception | |
private | |
def current_user | |
User.first | |
#@current_user ||= User.find(session[:user_id]) if session[:user_id] | |
end | |
helper_method :current_user | |
def require_login | |
unless current_user | |
#flash[:error] = "You must be logged in to access this section" | |
redirect_to new_session_path | |
end | |
end | |
def allow_iframe | |
response.headers.delete "X-Frame-Options" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment