Class: HttpErrorCats::ErrorsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/http_error_cats/errors_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



6
7
8
9
10
11
12
# File 'app/controllers/http_error_cats/errors_controller.rb', line 6

def show
  return unless HttpErrorCats.codes == :all
  return if HttpErrorCats.codes.is_a?(Array) && !HttpErrorCats.codes.include?(status_code)
  html = HttpErrorCats.html
  html = html.call status_code if html.is_a?(Proc)
  render inline: html, layout: HttpErrorCats.layout
end

#status_codeObject



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

def status_code
  params[:code] || 500
end