Unexpected behaviour when yielding a block of ERB #1590
Replies: 1 comment
-
@joeldrapper I totally missed this. Please reopen as an issue if this is still a problem ❤️ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a method that captures a block of ERB, e.g.
In ActionView, yielding this block causes the heading to be appended to the
view_context.output_buffer
but in ViewComponent, it returns\n
and adds nothing to the output buffer.Is ViewComponent using a different buffer? This is essentially what my method is doing:
But the heading is never added to
my_output
ormy_buffer
.I’ve tried to simplify this as much as possible. The real failing code can be found here. https://github.com/joeldrapper/phlex-rails/blob/3fb1d6be45be886470f54f0883347506c6b7c683/lib/phlex/rails/renderable.rb#L19-L35 and reproduction of the issue is available here. yippee-fun/phlex#368 (comment)
Beta Was this translation helpful? Give feedback.
All reactions