Hi,
I’m trying to produce a select menu with “optgroup” tags.
The HTML output should look like this:
In rails I’m typing this:
<%= f.select :member_1,
grouped_options_for_select ([[‘North America’,[[‘United
States’,‘US’],‘Canada’]],
[‘Europe’,[‘Denmark’,‘Germany’,‘France’]]]) %>
The result is that rails is adding the generated HTML to the select
menu, that is to say that in the generated menu, instead of seeing:
Europe
Denmark
France
etc …
I see
Denmarketc…
(See attachment)
Here is the HTML produced by Rails:
Can anyone help me to sort this out?
What am I doing wrong?
How do I properly create a menu with optgroup labels?
Thanks in advance for your help