Hi,
I'm making a simple search form in rails. In my search view I have two select boxes with fixed values like:
SELECT BOX 1 SELECT BOX 2
ALL, ALL,
FR, FR,
US, US,
DE DE
And I have 2 fields in my DB with country_from and country_to.
So for making a simple search like from FR to US I use:
@search_result = Load.find(:all, :conditions => "country_from='#{params[:country_from]}' AND country_to='#{params[:country_to]}'" )
that is fine, but I need to implement the ALL option as well, so when I make a search like from DE to ALL I get a list with all countries in country_to
I image I can do it with ifs...but what would be the most efficient way to do it?