diff options
| -rw-r--r-- | app/controllers/errors_controller.rb | 7 | ||||
| -rw-r--r-- | config/routes.rb | 10 |
2 files changed, 10 insertions, 7 deletions
diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb index 78e7285bc..accf119a3 100644 --- a/app/controllers/errors_controller.rb +++ b/app/controllers/errors_controller.rb @@ -1,13 +1,14 @@ class ErrorsController < ApplicationController def not_found - render status: 404, formats: [:html] + render template: 'errors/not_found', status: 404, formats: [:html] end def server_error - render status: 500, formats: [:html] + render template: 'errors/server_error', status: 500, formats: [:html] end def not_allowed - render status: 403, formats: [:html] + render template: 'errors/not_found', status: 403, formats: [:html] end end + diff --git a/config/routes.rb b/config/routes.rb index a8c332fb8..538c069ed 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -213,9 +213,11 @@ ChouetteIhm::Application.routes.draw do get '/help/(*slug)' => 'help#show' - get '/404', to: 'errors#not_found' - get '/403', to: 'errors#not_allowed' - get '/422', to: 'errors#server_error' - get '/500', to: 'errors#server_error' + if Rails.env.production? + get '404', to: 'errors#not_found' + get '403', to: 'errors#not_allowed' + get '422', to: 'errors#server_error' + get '500', to: 'errors#server_error' + end end |
