New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review, please: Capture block so content won't leak. #8936
Review, please: Capture block so content won't leak. #8936
Conversation
The [following pull request](#8916) fixed the block being passed to the appropriate helper method. However, the content being passed into the block is generating repeated markup on the page due to some weird ERb evaluation. This commit tries to capture the block's generated output so the page isn't flooded with markup, but I'm not able to make the tests pass due to a missing output buffer. Please help me review this behavior.
@rafaelfranca can you help me with this? |
This fix seems correct. |
@josevalim Indeed, but it breaks half a dozen tests and I'm not sure how to fix them. |
Seems like Correct usage is <%= f.collection_radio_buttons :category, Category.all, :id, :name do |b|%>
<% b.label { b.radio_button + b.text } %>
<%- end%> |
That's the short term correct answer, I thought of that too :) Thanks @vimutter However, |
@josemota yes, agree. Could you add some tests cases (for the raw template method and for the form helper)? |
@rafaelfranca OK. I'll give it a stab and see if I can pull it off. |
So I'm picking on the topic and, as I said, I'm getting 6 failing tests that look exactly the same:
I'm not understanding the meaning of this, should the helper contain that writer method and it does not? 😧 I feel obligated to make these tests green again before moving on, can anyone point me somewhere so I can take a better look? Thank you. |
@josemota I updated your commit with tests and the proper fix. Thank you so much |
Thanks @rafaelfranca! I apologize for not being able to solve the problem that was at hand, I really wanted to grasp the whole situation. Thanks for giving me a hint, I look forward to contributing more. |
No problem. Thank you for the bug report and the fixes. I applied because I want this fixes ASAP since I'll need to release simple_form 😄 |
Beware: tests are red.
The following pull request fixed
the block being passed to the appropriate helper method. However, the content
being passed into the block is generating repeated markup on the page due to
some weird ERb evaluation.
This commit tries to capture the block's generated output so the page isn't
flooded with markup, but I'm not able to make the tests pass due to a missing
output buffer. Please help me review this behavior.
Example 1 - it leaks markup to the page.
Example 2 - doesn't leak