Add error pages handling
Goals
Have nicer error pages in production
- 404 status
- 500 status
- 422 and 503 statuses
Changes
-
config/environments/production.rb
: switched html exception handling to app router -
config/routes.rb
: added get routes for html exceptions -
app/controllers/errors_controller.rb
: addedshow
method -
app/views/errors/404-422-500-503.html.erb
: added error page content -
app/assets/images/error_pages.jpg
: added background image for error pages -
app/assets/stylesheets/main.scss
: added custom style for errorjumbotron
Tests
-
error page 404 is correctly displayed for non existing page/route : PASSED - don't know how to test the other HTML statuses
Edited by Ghost User