-
I'm trying to understand why neither of these render the content into the component … <%= render MyComponent.new(thing: this_thing) { 'fancy string content' } %>
<%= render(MyComponent.new(thing: this_thing) { 'fancy string content' }) %> … but this does … <%= render MyComponent.new(thing: this_thing) do %>
fancy string content
<% end %> is it because the curly braces have higher precedence than do…end? (e) |
Beta Was this translation helpful? Give feedback.
Answered by
silent-e
Apr 26, 2023
Replies: 1 comment
-
Answering on my own. I had the parentheses in the wrong place in the curly brace version. THIS <%= render(MyComponent.new(thing: this_thing)) { 'fancy string content' } %> Not this <%= render(MyComponent.new(thing: this_thing) { 'fancy string content' }) %> the block should be passed to |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
silent-e
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Answering on my own. I had the parentheses in the wrong place in the curly brace version.
THIS
Not this
the block should be passed to
render
not the component.