Skip to content

Block content syntax? { } vs do…end #1726

Closed Answered by silent-e
silent-e asked this question in Q&A
Discussion options

You must be logged in to vote

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 render not the component.

Replies: 1 comment

Comment options

You must be logged in to vote
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
Category
Q&A
Labels
None yet
1 participant