Hemant Bhargava wrote:
> Hi Champs,
> 
> 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" })
> 
> Can you people push me into the right direction.
> 
> 
> - Cheers

Try below syntax.

City.find(:all, :conditions => [ "name != 'Bangalore'"] )



Thanks
Brijesh Shah
-- 
Posted via http://www.ruby-forum.com/.

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to