Class: ErrorsController

Inherits:
ApplicationController show all
Includes:
PagesCore::DocumentTitleController
Defined in:
app/controllers/errors_controller.rb

Instance Attribute Summary

Attributes included from PagesCore::Authentication

#current_user

Instance Method Summary collapse

Methods included from PagesCore::DocumentTitleController

#document_title

Methods included from PagesCore::StaticCacheController

#disable_static_cache!, #static_cached?

Methods included from PagesCore::PoliciesHelper

#policy, #verify_policy, #verify_policy_with_proc

Methods included from PagesCore::ProcessTitler

inc_number_of_requests, original_title

Methods included from PagesCore::LocalesHelper

#content_locale

Methods included from PagesCore::ErrorRenderer

#render_error

Methods included from PagesCore::Authentication

#authenticate!, #deauthenticate!, #logged_in?

Instance Method Details

#forbiddenObject



12
13
14
# File 'app/controllers/errors_controller.rb', line 12

def forbidden
  render_error 403
end

#internal_errorObject



28
29
30
31
32
33
34
35
36
# File 'app/controllers/errors_controller.rb', line 28

def internal_error
  exception = request.env["action_dispatch.exception"]
  if exception
    wrapper = ActionDispatch::ExceptionWrapper.new(nil, exception)
    render_error wrapper.status_code
  else
    render_error 500
  end
end

#not_foundObject



16
17
18
# File 'app/controllers/errors_controller.rb', line 16

def not_found
  render_error 404
end

#showObject



8
9
10
# File 'app/controllers/errors_controller.rb', line 8

def show
  render_error params[:id].to_i
end

#unacceptableObject



20
21
22
# File 'app/controllers/errors_controller.rb', line 20

def unacceptable
  render_error 422
end

#unauthorizedObject



24
25
26
# File 'app/controllers/errors_controller.rb', line 24

def unauthorized
  render_error 401
end