[Rails] Re: Performing nested queries in rails

2010-09-19 Thread Robert Pankowecki (rupert)
On Sep 17, 6:22 am, vishy wrote: > I am fairly new to rails and trying to learn rails by creating some > projects on my own. I am trying to perform a geo search on a > restaurant model and I am using geokit for that. My model stores the > latitude and longitude for the location. > > I am searchi

[Rails] Re: Performing nested queries in rails

2010-09-18 Thread pepe
> [...] Hence I am trying to apply the where condition on > @restaurants, using �...@restaurants = @restaurants.where("cuisine > like ?", params[:cuisine]). But that doesn't work. Once you've gotten @restaurants you are not querying the DB anymore, hence the 'where' should give you an error. @rest

[Rails] Re: Performing nested queries in rails

2010-09-17 Thread vishy
Restaurant.where(:cuisine => params[:cuisine]) will return all the Restaurants that that have the cuisine. However I am trying to filter the returned results from @restaurants = Restaurant.find(:all, :origin => @location, :within => 2) . Hence I am trying to apply the where condition on @restaurant

[Rails] Re: Performing nested queries in rails

2010-09-17 Thread Veera Sundaravel
If possible try with :conditions parameter. T.Veeraa http://tinyurl.com/25vma7h -- 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 rubyonrails-t...@googlegrou