Class: ErrorsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ErrorsController
- Defined in:
- app/controllers/errors_controller.rb
Overview
This controller is responsible for rendering custom error pages
User authentication is skipped for a faster response and to allow these pages to be accessible without a logged-in user.
The layout is set to false to avoid rendering the application layout.
All actions provide responses in HTML format, even if the request ends in a different format like .json or .png.
Constant Summary
Constants included from FlashTruncation
FlashTruncation::STRING_OVERHEAD
Instance Method Summary collapse
-
#internal_server_error ⇒ Object
500 Internal Server Error.
-
#not_found ⇒ Object
404 Not Found.
-
#service_unavailable ⇒ Object
503 Service Unavailable.
Methods inherited from ApplicationController
#block_api_access, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!
Methods included from FlashTruncation
#max_flash_size, #truncate_flash, #truncate_flash_array
Instance Method Details
#internal_server_error ⇒ Object
500 Internal Server Error
29 30 31 |
# File 'app/controllers/errors_controller.rb', line 29 def internal_server_error render status: :internal_server_error, formats: [:html] end |
#not_found ⇒ Object
404 Not Found
20 21 22 |
# File 'app/controllers/errors_controller.rb', line 20 def not_found render status: :not_found, formats: [:html] end |
#service_unavailable ⇒ Object
503 Service Unavailable
34 35 36 |
# File 'app/controllers/errors_controller.rb', line 34 def service_unavailable render status: :service_unavailable, formats: [:html] end |