How to use :selected with grouped_collection_select

后端 未结 3 1203
逝去的感伤
逝去的感伤 2021-01-13 04:01

Is it possible to somehow use the :selected option that you\'d use on a normal select view helper with the grouped_collection_select function? I\'d like to set the value th

3条回答
  •  广开言路
    2021-01-13 04:23

    Actually you need to send in options include_blank for example

    <%= grouped_collection_select :id, model.all, options = {:include_blank => 'Selecione'}%>
    

提交回复
热议问题