Kevin
Kevin

Reputation: 1614

Rails Geocoder Function

With the geocoder gem, if I wanted to find pictures nearby one particular picture by a mile I could do pictures.nearby(1) but what if I had a user with a location and wanted to find pictures nearby my user, how would I do that

Upvotes: 0

Views: 153

Answers (1)

Patrick
Patrick

Reputation: 8063

Instead of nearby() you can use

Pictures.near([u.lat, u.lon], 1)    # venues within 1 miles of a user

See GitHub/geocoder

Upvotes: 1

Related Questions