How to escape HTML entities inside array in Ruby on Rails?
I am trying to populate a select box with options from an array and escape
those options so currency symbols lile get displayed rather than €.
How can this be done in Ruby on Rails?
This is my function:
def options
array = []
array << ["$", "some value"]
array << ["€", "some value"]
end
And this is the form:
<%= f.select(:format, f.object.options) %>
I tried things like array.html_safe but unfortunately it's not working.
Thanks for any help.
No comments:
Post a Comment