Sha256: 7a4193f7eeed89437138a670b5e2667e63f8ae15b4f3e5241e6ac50c9a7b21ff

Contents?: true

Size: 652 Bytes

Versions: 4

Compression:

Stored size: 652 Bytes

Contents

# ErrorsController -> Controller to redirect error pages
class ErrorsController < ApplicationController
  layout 'errors/application'
  def not_authorized
    respond_error 'errors/not_authorized', 403
  end

  def not_found
    respond_error 'errors/not_found', 404
  end

  def unprocessable
    respond_error 'errors/unprocessable', 422
  end

  def internal_server_error
    respond_error 'errors/internal_server_error', 500
  end

  private

  def respond_error(template, status)
    respond_to do |format|
      format.html { render template: template, status: status }
      format.all { render nothing: true, status: status }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
keppler-2.0.3 installer/core/app/controllers/errors_controller.rb
keppler-2.0.2 installer/core/app/controllers/errors_controller.rb
keppler-2.0.1 installer/core/app/controllers/errors_controller.rb
keppler-2.0.0 installer/core/app/controllers/errors_controller.rb