From 117f6638d0c402162c60915c7b8946489f1e89df Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 5 Apr 2021 13:05:49 +0200 Subject: [PATCH] Fix SVG files not being correctly included in templates (#16001) In Rails 6.1, raw file inclusion in templates have to be explicitly marked as HTML-safe, otherwise it's rendered as text. --- app/views/layouts/application.html.haml | 4 ++-- app/views/layouts/embedded.html.haml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 436024ee3..f5a963e00 100755 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -39,5 +39,5 @@ = content_for?(:content) ? yield(:content) : yield .logo-resources - = render file: Rails.root.join('app', 'javascript', 'images', 'logo_transparent.svg') - = render file: Rails.root.join('app', 'javascript', 'images', 'logo_full.svg') + = raw render file: Rails.root.join('app', 'javascript', 'images', 'logo_transparent.svg') + = raw render file: Rails.root.join('app', 'javascript', 'images', 'logo_full.svg') diff --git a/app/views/layouts/embedded.html.haml b/app/views/layouts/embedded.html.haml index e4311d342..719c21a9a 100644 --- a/app/views/layouts/embedded.html.haml +++ b/app/views/layouts/embedded.html.haml @@ -21,4 +21,4 @@ = yield .logo-resources - = render file: Rails.root.join('app', 'javascript', 'images', 'logo_transparent.svg') + = raw render file: Rails.root.join('app', 'javascript', 'images', 'logo_transparent.svg')