Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions