When using formtastic in my rails3 application, I can't get the dropdown menus to work. Instead they appear as a selection list.
My code looks like this:
<%= f.label :slas, "Service" %></td><td><%= f.input :slas, :collection => @slas %>
Is this something I开发者_如何学Python need to change in the css?
Wow, that took some fiddling.
In order to get a single dropdown list, instead of the select box, I needed to do this:
<%= f.label :slas, "Service" %></td><td><%= f.input :slas, :as => :select, :multiple => false, :input_html => { :size => 1 } %>
That was surprisingly hard...
That's strange. :as => :select
should have done the trick by itself.
精彩评论