summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 2843d70c645..db8a8cdc0d2 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -146,14 +146,15 @@ class ApplicationController < ActionController::Base
end
def render_403
- head :forbidden
+ respond_to do |format|
+ format.any { head :forbidden }
+ format.html { render "errors/access_denied", layout: "errors", status: 403 }
+ end
end
def render_404
respond_to do |format|
- format.html do
- render file: Rails.root.join("public", "404"), layout: false, status: "404"
- end
+ format.html { render "errors/not_found", layout: "errors", status: 404 }
# Prevent the Rails CSRF protector from thinking a missing .js file is a JavaScript file
format.js { render json: '', status: :not_found, content_type: 'application/json' }
format.any { head :not_found }