I want to create a shortcut with some nested elements. I use a helper tag and try to pass the internal html as a block, but the generated HTML does not look the way I expected. Euroradio:
<span>Span element</span> <%= label("object", "method") do %> <span>Inner span</span> <% end %>
HTML output:
<span>Span element</span> <span>Inner span</span> <label for="object_method"> <span>Span element</span> <span>Inner span</span> </label>
When I pass in the internal html using <%%> markup output, as it should be:
ERB:
<span>Span element</span> <%= label("object", "method") do %> <% raw '<span>Inner span</span>' %> <% end %>
HTML output:
<span>Span element</span> <label for="object_method"> <span>Inner span</span> </label>
I am wondering if this is my mistake or error in the ActionView label helper. For other assistants, the transmission lock works fine.
Thanks Michal
source share