I have a little problem trying to display specific locations based on user proximity. In my controller, I have the following:
if User.find(current_user) @user = User.find(current_user) @locations = Location.near(params[:latitude => @user.latitude, :longitude => @user.longitude], 50, :order => :distance) end
Users have latitude and longitude. I think that I do not have the correct parameters in the Location.near line, but I cannot understand what they should be.
Any help would be appreciated.
Hurrah!
source share