app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def current_user
    if session[:user]
      @current_user ||= User.find(session[:user]) if session[:user]
    else
      @current_user = nil
    end
  end
def current_user if session [ :user ] @current_user ||= User . find ( session [ :user ] ) if session [ :user ] else @current_user = nil end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .