Jenny Blunt
Jenny Blunt

Reputation: 1596

Formtastic Collection Select Dropdown

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 need to change in the css?

Upvotes: 0

Views: 2145

Answers (2)

kakubei
kakubei

Reputation: 5400

That's strange. :as => :select should have done the trick by itself.

Upvotes: 0

Jenny Blunt
Jenny Blunt

Reputation: 1596

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...

Upvotes: 1

Related Questions