I am trying to search an Item model with a filter named genres that are connected by has_many through.
My problem is when I select two genres or more, it also selects records that contain only one genre.
This is my filter statement under the controller
@item = Item.includes(:genres).where('genres.id' => params['genre_ids'])
Aucun commentaire:
Enregistrer un commentaire