Unexpected behaviour when yielding a block of ERB #1590
Unanswered
joeldrapper
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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. phlex-ruby/phlex#368 (comment)
Beta Was this translation helpful? Give feedback.
All reactions