How do I use the Bootstrap form select css with a Rails model?

后端 未结 2 931
北海茫月
北海茫月 2021-02-13 13:45

I want to use the Bootstrap css to style a \"select\" box in a form in a Ruby on Rails app.

On the Bootstrap site, they give this as an example:



        
2条回答
  •  有刺的猬
    2021-02-13 14:24

    This works for me:

    <%= f.select :secretquestion, options_for_select([
      ["Select One", ""], 
      "Your nick name", 
      "your schoool name", 
      "your love name", 
      "your comapnay name", 
      "your favourite website"]), 
      {}, { class: "form form-group form-control" } %>
    

提交回复
热议问题