【问题标题】:Rails collection_select + bootstrap dropdownRails collection_select + bootstrap 下拉菜单
【发布时间】:2015-12-03 00:18:50
【问题描述】:
<div class="dropdown">
...
 <%= ff.collection_select :vendor_id, @vendors, :id, :vendor, :include_blank => true, class: "dropdown-menu" %> 
...
</div>

我有一个表单,然后我使用如上所示的 fields_for 来收集输入。但是我看不到here 所示的程式化引导下拉菜单。我应该进行哪些更改才能看到引导风格化的下拉菜单?

【问题讨论】:

    标签: css twitter-bootstrap ruby-on-rails-4


    【解决方案1】:

    来自

    <%= 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 = {})

    【讨论】:

      猜你喜欢
      • 2015-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-06
      • 2012-02-21
      相关资源
      最近更新 更多