Class: Workarea::Storefront::ErrorsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Workarea::Storefront::ErrorsController
- Defined in:
- app/controllers/workarea/storefront/errors_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#current_layout, #current_user_info, #health_check, #layout_content
Methods included from OrderLookup
Methods included from UserActivity
#current_user_activity_id, #user_activity
Methods included from CurrentCheckout
#clear_current_order, #completed_order, #completed_order=, #current_checkout, #current_order, #current_order=, #current_shipping, #current_shippings
Methods included from HttpCaching
Instance Method Details
#internal ⇒ Object
16 17 18 19 20 21 |
# File 'app/controllers/workarea/storefront/errors_controller.rb', line 16 def internal # This ensures any exception handling (e.g. Airbrake or Sentry) will see # the error in their middleware, and then report on it. request.env['rack.exception'] = request.env['action_dispatch.exception'] render_error_page(500) end |
#not_found ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/workarea/storefront/errors_controller.rb', line 4 def not_found redirect_url = ::Redirect.find_destination( request.env['action_dispatch.original_path'] ) if redirect_url.present? redirect_to redirect_url, status: :moved_permanently else render_error_page(404) end end |
#offline ⇒ Object
23 24 25 26 27 28 |
# File 'app/controllers/workarea/storefront/errors_controller.rb', line 23 def offline content = Content.for('offline') @content = ContentViewModel.wrap(content) render('workarea/storefront/errors/show') end |