From edeba87f56a09e66b3c7244875873bd2cceeae2d Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Fri, 8 Nov 2019 07:25:11 +1300 Subject: [PATCH] Fix `render file:` deprecation warning (#3454) DEPRECATION WARNING: render file: should be given the absolute path to a file We were giving it an absolute path, but removing the `.html` so it was causing a deprecation warning to be shown while running this code. --- core/lib/refinery/application_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/lib/refinery/application_controller.rb b/core/lib/refinery/application_controller.rb index daf4347c06..db50738723 100644 --- a/core/lib/refinery/application_controller.rb +++ b/core/lib/refinery/application_controller.rb @@ -31,8 +31,7 @@ def error_404(exception = nil) # fallback to the default 404.html page. file = Rails.root.join 'public', '404.html' file = Refinery.roots('refinery/core').join('public', '404.html') unless file.exist? - render file: file.cleanpath.to_s.gsub(%r{#{file.extname}$}, ''), - layout: false, status: 404, format: :html + render file: file, format: :html, layout: false, status: 404 return false end