Sha256: f4980eb7991956912e59ebac71cf6a0d81d4c7f20e24f39541886f001bf22dd8
Contents?: true
Size: 672 Bytes
Versions: 24
Compression:
Stored size: 672 Bytes
Contents
module PandaCms class ErrorsController < ApplicationController layout "error" def show exception = request.env["action_dispatch.exception"] status_code = exception.try(:status_code) || ActionDispatch::ExceptionWrapper.new(request.env, exception).status_code render view_for_code(status_code), status: status_code end def error_503 render view_for_code(503), status: 503 end private def view_for_code(code) supported_error_codes.fetch(code, "404") end def supported_error_codes { 403 => "403", 404 => "404", 500 => "500", 503 => "503" } end end end
Version data entries
24 entries across 24 versions & 1 rubygems