Ransack検索で複数チェックボックスに対応させる方法

<label>
<%= f.check_box :content_category_id_eq_any, { multiple: true }, 1, '' %>
</label>
<label>
<%= f.check_box :content_category_id_eq_any, { multiple: true }, 2, '' %>
</label>

構文は以下の通り。
check_box :検索対象カラム_eq_any, { multiple: true }, checked_value, unchecked_value
eq_anyとmultiple: trueを使うこと。

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です