I have a block of code in my view like this:
<% @map[value].each do |i| %>
<%= f.check_box(i)%> <%= f.label(i)%><br />
<% end %>
'i' is having string like
a_b_c. But it is displayed as
a b c without underscores on the view. Please let me know how to print the string as it is on the page without trimming the underscores. Also please let me know why f.label is trimming the underscores.
label is helpful for 80% of the cases where you pass it a property symbol, which will often contain underscores. It strips out the underscores when generating the label text because most of the time you don't want the label to read something like
You can pass a string as a second argument to override what the text of the label appears as.
<%= f.label(i, "a_b_c") %>
So maybe you can try something like this?
<%= f.label(i, i) %>