Class: ErrorsController

Inherits:
ApplicationController show all
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::StaticCacheController

#disable_static_cache!

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::ErrorRenderer

#render_error

Methods included from PagesCore::Authentication

#authenticate!, #deauthenticate!, #logged_in?

Instance Method Details

#forbiddenObject



10
11
12
# File 'app/controllers/errors_controller.rb', line 10

def forbidden
  render_error 403
end

#internal_errorObject



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

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



14
15
16
# File 'app/controllers/errors_controller.rb', line 14

def not_found
  render_error 404
end

#showObject



6
7
8
# File 'app/controllers/errors_controller.rb', line 6

def show
  render_error params[:id].to_i
end

#unacceptableObject



18
19
20
# File 'app/controllers/errors_controller.rb', line 18

def unacceptable
  render_error 422
end

#unauthorizedObject



22
23
24
# File 'app/controllers/errors_controller.rb', line 22

def unauthorized
  render_error 401
end