<div class="dropdown">
...
<%= ff.collection_select :vendor_id, @vendors, :id, :vendor, :include_blank => true, class: "dropdown-menu" %>
...
</div>
我有一个表单,然后我使用如上所示的fields_for来收集输入。但我无法看到here所示的程式化引导下拉列表。我应该做些什么改变才能看到bootstrap风格化下拉列表?
答案 0 :(得分:4)
这
<%= ff.collection_select :vendor_id, @vendors, :id, :vendor, :include_blank => true, class: "dropdown-menu" %>
到
<%= ff.collection_select :vendor_id, @vendors, :id, :vendor, {:include_blank => true}, {class: "dropdown-menu"} %>
collection_select(object,method,collection,value_method,text_method,options = {},html_options = {})