Rails and Searchlogic: finding products that matching all given product categories by using searchlo
Posted
by Roland
on Stack Overflow
See other posts from Stack Overflow
or by Roland
Published on 2010-03-25T15:02:35Z
Indexed on
2010/03/25
15:03 UTC
Read the original article
Hit count: 548
I have a model Publication and a model Category in my Rails app. Both are connected with a has_and_belongs_to_many association.
Now I would like to search publications that match one or more categories. If more than one category is given they have all assigned to the publication. I want to specify the categories in a multiple select_box.
Publication.released.categories_id_is([1,2])
is not working because the categories are connected with OR.
With Publication.categories_id_is_all([1,2])
the categories are connected with AND, but no result is given back.
Any idea's on that? Am I mising the right point in the docs. Thanks for your very welcome help!
© Stack Overflow or respective owner