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 flash_and_redirect_back_with_message(exception)
    flash[:error] = exception.message
    unless flash[:error].present?
      case exception
      when NotAuthorized
        flash[:error] = 'You are not authorized to perform this action'
      when GitHub::Error, GitHub::Forbidden, GitHub::NotFound
        flash[:error] = 'Uh oh, an error has occured.'
      end
    end
    redirect_to :back
  end
def flash_and_redirect_back_with_message ( exception ) flash [ :error ] = exception . message unless flash [ :error ] . present? case exception when NotAuthorized flash [ :error ] = 'You are not authorized to perform this action' when GitHub :: Error , GitHub :: Forbidden , GitHub :: NotFound flash [ :error ] = 'Uh oh, an error has occured.' end end redirect_to :back end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .
exception
<not_specific>