Skip to content
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

Methods that take a block shouldn't be called with plain #285

Open
marcoroth opened this issue Feb 5, 2024 · 0 comments
Open

Methods that take a block shouldn't be called with plain #285

marcoroth opened this issue Feb 5, 2024 · 0 comments

Comments

@marcoroth
Copy link
Owner

ERB Input:

<%= something do %>
  Content
<% end %>

Output:

plain something do
  plain " Content"
end

Expected output:

something do
  plain " Content"
end

@adamlogic experienced this in the GoRails Phlex episode: https://youtu.be/l4bQSfqZZfQ&t=1267

I'm not sure if this is actually solvable. Since the ERB is using <%= we expect to output the return value of the method call. If the ERB is just <% the output works as expected. Like:

<% something do %>
  Content
<% end %>

Outputs:

something { plain " Content" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant