I have 5 select’s in my html code. I send them to controller, but for example some of them could be empty (default value is 0), so for example in some case i need to search only via params[:size] is some case only via params[:capacity] and in other params[:size] and params[:capacity] both as well… But how do to this? how to operate with find etc?
now i have something like this:
size = "*"+params[:akbsize]+"*"
@accums = Accumulator.find(:all, :conditions => ["MATCH(description) AGAINST (? in boolean mode)", size])
cap = "*"+params[:akbcapacity]+"*"
@accums2 = Accumulator.find(:all, :conditions => ["MATCH(description) AGAINST (? in boolean mode)", cap])
But how to do as i described? Is it good to do here with metasearch gem?
You could make method for it like so:
Then on your controller:
This would accomplish what u want. I think that the method all wouldn’t be necessary at all.
=)