app/controllers/application_controller.rb
# custom method to render an appropriate response to an exception
custom method to render an appropriate response to an exception
custom method to render an appropriate response to an exception
def render_exception_response(exception, response_code, status_code)
    case response_code
    when :unauthorized 
      logged_in? ? access_denied(exception) : must_be_logged_in(exception)
    when :forbidden
      access_denied(exception)
    when :not_implemented
      not_yet_implemented
    else
      respond_to do |format|
        format.html do
          @error_page_title = I18n.t("error_#{status_code}_page_title", default: [:error_default_page_title, "Error."])
          @status_code = status_code
          render layout: 'errors', template: 'content/error', status: status_code
        end
        format.js do
          render layout: false, template: 'content/error', status: status_code
        end
        format.all do
          @error_page_title = I18n.t("error_#{status_code}_page_title", default: [:error_default_page_title, "Error."])
          @status_code = status_code
          render layout: 'errors', template: 'content/error', status: status_code, formats: 'html', content_type: Mime::HTML.to_s
        end
      end
    end
  end
def render_exception_response ( exception , response_code , status_code ) case response_code when :unauthorized logged_in? ? access_denied ( exception ) : must_be_logged_in ( exception ) when :forbidden access_denied ( exception ) when :not_implemented not_yet_implemented else respond_to do | format | format . html do @error_page_title = I18n . t ( "error_#{status_code}_page_title" , default : [ :error_default_page_title , "Error." ] ) @status_code = status_code render layout : 'errors' , template : 'content/error' , status : status_code end format . js do render layout : false , template : 'content/error' , status : status_code end format . all do @error_page_title = I18n . t ( "error_#{status_code}_page_title" , default : [ :error_default_page_title , "Error." ] ) @status_code = status_code render layout : 'errors' , template : 'content/error' , status : status_code , formats : 'html' , content_type : Mime :: HTML . to_s end end end end
custom method to render an appropriate response to an exception
custom method to render an appropriate response to an exception
# This is caused by MustBeLoggedIn, actually...
exception
<not_specific>
response_code
<not_specific>
status_code
<not_specific>