How can I put an HTML tag inside a <label> in Ruby on Rails?
Label accepts a block, so you can do this:
<%= f.label :test do %>
<span>*</span>
<%end%>
You need to tell rails that the string you're giving it does not need to be sanitized. Use String#html_safe
.
<%= f.label :test, "test<span>*</span>".html_safe %>