下記のコードだと一つ選択した場合は機能するのですが、複数選択するとそれに該当するものがあっても引っかかりません。
ruby
1def index 2 @q = Post.search(params[:q]) 3 @posts = @q.result.includes(:type, :genres) 4end
ruby
1<%= f.collection_check_boxes :genres_id_eq_all, Genre.all, :id, :name %>
ruby
1def search_params 2 params.require(:q).permit({:genres_id_eq_all => []}) 3end
よろしくお願いします。
あなたの回答
tips
プレビュー