# Will paginate + Google Maps = craziness

**URL:** <https://www.ruby-forum.com/t/will-paginate-google-maps-craziness/138547>\
**Category:** Rails\
**Created:** [May 24, 2008, 12:58pm UTC](https://www.ruby-forum.com/t/will-paginate-google-maps-craziness/138547 "2008-05-24T12:58:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_Poz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c5a1d2/32.png) [@J\_Poz](https://www.ruby-forum.com/u/J_Poz)\
**Post date:** [May 24, 2008, 12:58pm UTC](https://www.ruby-forum.com/t/will-paginate-google-maps-craziness/138547/1 "2008-05-24T12:58:31Z")

</div>

Hello all,

I’ve got a problem, and I’m totally stumped.

I’m using the Geokit plugin (finds lat/lng of addresses) along with  
the will\_paginate gem.

What I’m trying to do is have paginate search for the closest location  
to the current user and have pages of results.

The Geokit plugin has this nice find\_within function, but you can’t  
just paginate.find\_within(…).

Does anyone know how I could to a paginate call to find the closest  
location using two geocoded locations?

I’ve got it setup in the database that every users has a lat and lng  
and each location also has a lat and lng.

Thanks in advance for the help,  
J Poz
