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
Instead of nearby() you can use
Pictures.near([u.lat, u.lon], 1) # venues within 1 miles of a user
See GitHub/geocoder
精彩评论