Fix render_in returning non-html_safe string when render? is false#2584
Merged
joelhawksley merged 4 commits intomainfrom Mar 25, 2026
Merged
Fix render_in returning non-html_safe string when render? is false#2584joelhawksley merged 4 commits intomainfrom
render_in returning non-html_safe string when render? is false#2584joelhawksley merged 4 commits intomainfrom
Conversation
Co-authored-by: joelhawksley <1940294+joelhawksley@users.noreply.github.com> Agent-Logs-Url: https://github.com/ViewComponent/view_component/sessions/bfc044d6-6ca7-4999-a544-ff12b3f1b00d
Copilot
AI
changed the title
[WIP] Fix render_in to return html_safe empty string when render? is false
Fix Mar 25, 2026
render_in returning non-html_safe string when render? is false
Member
joelhawksley
left a comment
There was a problem hiding this comment.
Looks good, please add a changelog
Member
|
@copilot please add a changelog entry |
Co-authored-by: joelhawksley <1940294+joelhawksley@users.noreply.github.com> Agent-Logs-Url: https://github.com/ViewComponent/view_component/sessions/039c0c05-2746-411e-acce-af421239caa1
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
render?returnsfalse,render_inreturned a plain""instead of"".html_safe, making it inconsistent with the happy path and causingTypeErrorwhen concatenating with otherSafeBufferstrings.Changes
lib/view_component/base.rb: Return"".html_safeinstead of""in therender?false branchtest/sandbox/test/rendering_test.rb: Add assertion thatrender_inoutput is html-safe whenrender?is false🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.