Skip to content

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

@marcoroth

Description

@marcoroth

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" }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions