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 auth_required
    unless current_user
      session[:target_url] = request.fullpath
      redirect_to new_session_path, flash: { error: 'This site is protected.  Please log in.' }
    end
  end
def auth_required unless current_user session [ :target_url ] = request . fullpath redirect_to new_session_path , flash : { error : 'This site is protected.  Please log in.' } end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .