开发者

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开发者_如何学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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜