I have a model Phone with checked_by field; if this field is equal to 1, then we know this phone is unchecked, else(>1) – checked. On admin side I can review a list of Phones and I need to create a filter using meta_search to review:
- All Phones
- Checked
- Unchecked
I can see checked_by_greater_than, or checked_by_less_than methods in meta_search, but how to combine those methods in a single select box?
Thanks in any advise
With a scope and a made-up field.
The scope:
Then add a select-box with three values, returning
[nil, 0, 1]as values, and in your controller use that parameter to apply the new scope.