I’m having trouble using special characters with &-notation in ruby on rails forms. Have a look:
<% form_for(@object) do |f| %>
<%= f.select :field, [['option 1', 1], [' option 1.1', 2]] %>
<% end %>
As you see, option 1.1 should have two whitespaces in the front, it should look indented in the dropdown list. Being HTML, this does not work, I should use . How do I do this in this case?
If your aim is to visually display indentation only, use CSS and set a class on the relevant options:
If
is supposed to be part of the text (I guess not?), then you can use raw():Ps. Proper name for “&-notation” is “HTML character entity references”