I have a Rails 3 application set to use HTML5. I previously programmed a select tag to display some values from an active record query. Now when I run the application the default display is being set to none though I do not have that style attribute set in any of the application stylesheets. Even when I use in-line styling such as
<div id="models">
<select style="display:block;">
<% @models.each do |model| %>
<option value="<%= model.id %>" ><%= model.name %></option>
<% end %>
</select>
</div>
the element’s style attribute is still being set to “display: none;”.
Do anyone have any suggestions?
I would recommend trying collection_select, something like:
e.g.
and set my-class in your stylesheet.