Rails, searchlogic choose categories with checkboxes

Posted by atmorell on Stack Overflow See other posts from Stack Overflow or by atmorell
Published on 2009-07-25T01:01:42Z Indexed on 2010/03/25 0:23 UTC
Read the original article Hit count: 692

Filed under:
|

Hello,

I am useing searchlogic to search some paintings. Each painting belong to a single category. What I would like to do is add multiple checkboxes to my search form, so that users can mark multiple categories. (joined with or) Is this possible with searchlogic? The query I am looking for is something like this:

SELECT * FROM paintings WHERE category LIKE "white" OR category LIKE "red"...

f.check_box :category (white)
f.check_box :category (black)
f.check_box :category (red)
f.check_box :category (green)

etc.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby