aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlatka Pavisic2017-04-20 14:18:01 +0200
committerVlatka Pavisic2017-04-20 14:18:01 +0200
commitc1eccef1259c7f7068f0b2f9dad15c79cdae49b1 (patch)
tree041e38b41ed6ec24895bab9c5ecd220863bc4d65
parent23403a7344eeb2d0c4f052c984baa49b8c58154c (diff)
downloadchouette-core-c1eccef1259c7f7068f0b2f9dad15c79cdae49b1.tar.bz2
Refs #3033 : Attempt #2 to display 403 page
-rw-r--r--app/controllers/errors_controller.rb7
-rw-r--r--config/routes.rb10
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