FIX: Properly render server side plugin outlets (#8106)

FIX: Properly render server side plugin outlets (#8106)

The behavior of the render helper method changed in Rails 6 so now the method doesn’t render the template and return the output, instead it just returns the file content as-is. Context: Discourse Sitemap Plugin - plugin - Discourse Meta

diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ff7cc87..9d7b6e4 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -384,7 +384,7 @@ module ApplicationHelper
     return "" if erbs.blank?
 
     result = +""
-    erbs.each { |erb| result << render(file: erb) }
+    erbs.each { |erb| result << render(inline: File.read(erb)) }
     result.html_safe
   end

GitHub sha: 57db3c1f

1 Like