remove a blank option of select field that was generated by SimpleForm

前端 未结 3 2066
闹比i
闹比i 2021-02-03 17:48

I have this piece of code:

= f.input :category, :as => :select, :label => false, :collection => Choices[\"Categories\"]

Choices[\"Cate

3条回答
  •  庸人自扰
    2021-02-03 18:05

    You can pass a include_blank: false, include_hidden: false option:

    = f.input :category, :as => :select, :label => false, :collection => Choices["Categories"], include_blank: false, include_hidden: false
    

提交回复
热议问题