From d8b3f613e30d08aeaf8c94d7ca7e0cabdfb4c259 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Wed, 28 Feb 2024 13:20:41 -0800 Subject: [PATCH] Fix AccessDenied error handler I don't think people see this very often visually, but it's showing up in our error logging! The Rails API changed here long ago and we didn't notice: to render public files, we should use the `file` argument instead of `template`. --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d29ab94a..c8df5d4b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -57,7 +57,7 @@ class ApplicationController < ActionController::Base rescue_from AccessDenied, :with => :on_access_denied def on_access_denied - render template: 'public/403.html', :layout => false, :status => :forbidden + render file: 'public/403.html', layout: false, status: :forbidden end def redirect_back!(default=:back)