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
> [...] 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
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
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
4 matches
Mail list logo