app/controllers/runs_controller.rb
# flash back if condition is true.
flash back if condition is true.
flash back if condition is true .
def flash_back(condition, message = nil)
    if condition
      flash.now[:error] = message
      if request.xhr?
        render :update do |page|
          page.redirect_to :back
        end
      else
        redirect_to :back
      end
      return false
    end
  end
def flash_back ( condition , message = nil ) if condition flash . now [ :error ] = message if request . xhr? render :update do | page | page . redirect_to :back end else redirect_to :back end return false end end
flash back if condition is true.
flash back if condition is true .
condition
<not_specific>
message
<not_specific>