Reputation: 2662
I want to write this HTML in ERB:
<a href="/" id="logo">One<span id="red>Two</span></a>
How do I include the span?
<%= link_to "ONETWO", root_path, id: "logo" %>
Upvotes: 0
Views: 1515
Reputation: 26193
Inline:
<%= link_to(raw('One<span id="red">Two</span>'), root_path, id: "logo") %>
Upvotes: 3
Reputation: 12554
just use the block form of this helper :
<%= link_to root_path, id: :logo do %>
One<span id="red>Two</span>
<% end %>
Other helpers support this form, like content_for
.
Upvotes: 5