views:

211

answers:

1

I just tried creating an Event on EventBrite and they have this nice autocomplete input for cities (start typing "san" and it will bring up "San Francisco, California..." and a list of others).

What's the best way to do that? Do you need to store that in a local database or do people make those ajax calls to something like google maps or yelp?

And is there a component/project for this in Rails??

+2  A: 

I did something like that with this database :

http://www.geonames.org/export/

But you can also use their webservices if you don't want to have a local database.

You won't be able to call google or even geonames with ajax because you can't do cross-domain request, you'll have to do the request on the server-side.

remi bourgarel