The application I’m developing allows people to create events in their
area; as part of this feature I want to display a list of, say, the five
most recent events within 30 miles of a person’s location.
I have a User model and a Profiles model which contains the user’s
(city, state, zip code) among other non-related personal information.
what I would like to do is be able to do is to get a list of upcoming
relative to that person’s location, and display it on their “control
when they log in to the site.
Also, at some point in the future I want to integrate with Google Maps
display a map of the Event’s location on a particular event’s detail
(i.e. “show” action in the controller); this isn’t required for the Beta
version of the site, but it’s something to consider since it will be a
I’ve been looking at the Google Maps API but I’m not sure if it would
do what I really need, which is to query for all zip codes within 30
of a given zip code, so I can display the events to users who live
that radius and hopefully get them to attend.
I have the book “RailsSpace”, and it implements something similar to
want with a database, but if I go this route will it prevent me from
Google Maps at a later date? I haven’t really looked yet to see if
are any plugins that can help me out with this - I want to get a handle
the concepts I need, and then work on the implementation.
To summarize, what I want to be able to do is:
- Display a list of the five most recent events within 30 miles of a
location on their profile page
- Send an email to all users within 30 miles of an event upon creation,
notifying them that a new event has been scheduled in their area (this
can probably figure out myself once I have the location part done)
- Enable a user to search for upcoming events within a specified radius
- At some point in the future, integrate with Google Maps to display a
of the event in question; presumably this would be based on the event’s
Anyone have any pointers on how to accomplish this? My main point of
concern is I’m not sure if I should use the approach of the RailsSpace
which as I recall is to set up a database containing the location data,
do some funky math to get the radius, or if there’s some third-party API
available that I could mash-up with and leverage, especially if it would
make future integration easier.
Any help would be appreciated.