Users can currently apply filters to the database query by checking the boxes, for example.
Colour
[] Red
[] Green
[] Blue
Shape
[] Round
[] Square
Size
[] Small
[] Medium
[] Large
When you click on the flag, an AJAX request is launched, which adds a condition whereto the request, for example.
@mymodel = MyModel.scoped
@mymodel = @mymodel.where(:colour => params[:colour]) if params[:colour]
...
Now I need to add a counter after each checkbox to indicate how many results will be displayed if this checkbox is selected. eg.
Colour
[] Red (148)
[] Green (121)
[] Blue (136)
...
When you click on the checkbox, the checkboxes next to all the checkboxes should be updated, and the parameters related to the zero result will not be displayed. This should work in all categories of filters, therefore, for example, if there is nothing small and red in the database, the Small option should disappear when Red is selected, and will appear again when it is canceled.
?
.
, : Rails?
( @Pasta )