Class: ExceptionHandler::ExceptionController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/exception_handler/exception_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject

Show



22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/controllers/exception_handler/exception_controller.rb', line 22

def show
  @layout = self.send(:_layout)
  @message = (/^(5[0-9]{2})$/ !~ @status.to_s) ? "Sorry, this page is missing" : details[:message]

  ## Config "404 block" handler ##

  if /^(5[0-9]{2})$/ !~ @status.to_s && ExceptionHandler.config["404"] #-> http://www.justskins.com/forums/ruby-s-regexp-is-52846.html

    eval ExceptionHandler.config["404"]
  else
    ## Render (if eval do anything) ##

    render status: @status
  end
end