Hanging out with a problem..
I can find out the name of cities with City.find(:all)..
I can find out the Bangalore city with City.find_by_name("Bangalore").
But what query i have to write to find the name of all cities except
"Bangalore" ?
I tried this but of no use .. City.find(:all, :conditions => { :name !=
"Bangalore" })
Hanging out with a problem..
I can find out the name of cities with City.find(:all)..
I can find out the Bangalore city with City.find_by_name("Bangalore").
But what query i have to write to find the name of all cities except
"Bangalore" ?
I tried this but of no use .. City.find(:all, :conditions => { :name !=
"Bangalore" })
I am having Bangalore in an variable. I mean lets suppose selected_city.
Then i tried this:-
City.find(:all, :conditions => [ "name != selected_city" ]
I am having Bangalore in an variable. I mean lets suppose selected_city.
Then i tried this:-
City.find(:all, :conditions => [ "name != selected_city" ]