Rails Ransack 在多个 select 中包含空白
Rails Ransack include blank in multiple select
我在 Rails 3.2 应用程序中使用 gem Ransack。
以下适用于 select 多个值:
<td><%= f.collection_select :costproject_coststatus_id_in, Coststatus.all, :id, :statuscode, {}, { :multiple => true}
但是,有没有办法包含空格?
我试过这些:
<td><%= f.collection_select :costproject_coststatus_id_in, Coststatus.all, :id, :statuscode, {}, { :multiple => true, :include_blank => true }%></td>
<td><%= f.collection_select :costproject_coststatus_id_in, Coststatus.all, :id, :statuscode, include_blank: true, {}, { :multiple => true }%></td>
感谢帮助!!
好的 - 这有效:
<td><%= f.collection_select :costproject_coststatus_id_in, Coststatus.all, :id, :statuscode, {:include_blank => true}, { :multiple => true }%></td>
我在 Rails 3.2 应用程序中使用 gem Ransack。
以下适用于 select 多个值:
<td><%= f.collection_select :costproject_coststatus_id_in, Coststatus.all, :id, :statuscode, {}, { :multiple => true}
但是,有没有办法包含空格?
我试过这些:
<td><%= f.collection_select :costproject_coststatus_id_in, Coststatus.all, :id, :statuscode, {}, { :multiple => true, :include_blank => true }%></td>
<td><%= f.collection_select :costproject_coststatus_id_in, Coststatus.all, :id, :statuscode, include_blank: true, {}, { :multiple => true }%></td>
感谢帮助!!
好的 - 这有效:
<td><%= f.collection_select :costproject_coststatus_id_in, Coststatus.all, :id, :statuscode, {:include_blank => true}, { :multiple => true }%></td>