Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ nav_order: 5

*Olle Jonsson*

* Avoid duplicating rendered string when `output_postamble` is blank.

*Mitchell Henke*

## 3.8.0

* Use correct value for the `config.action_dispatch.show_exceptions` config option for edge Rails.
Expand Down
7 changes: 6 additions & 1 deletion lib/view_component/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ def render_in(view_context, &block)
before_render

if render?
render_template_for(@__vc_variant).to_s + output_postamble
# Avoid allocating new string when output_postamble is blank
if output_postamble.blank?
render_template_for(@__vc_variant).to_s
else
render_template_for(@__vc_variant).to_s + output_postamble
end
else
""
end
Expand Down