Can someone point me to the right direction on how to make Searchkick
only return what was passed on the search box plus what was chosen in the category dropdown?
So here's how my current Searchkick
feature works. I added Searchkick
to my model business.rb
and this belongs to the model category.rb
.
I already implemented the basic usage of Searchkick
which is to return what was passed on the search box e.g. I passed the address "Sample 123 St." and it will return all businesses of all categories with that address.
But now, I want to only return what was passed on the search box plus what was chosen on the category dropdown e.g. I passed the address "Sample 123 St." and chose "School" in the dropdown category and will only return "School" with that address.
Try to add the category id in where conditions.
Like this