On Sep 12, 12:18 am, Salil G. [email protected]
I need to a implement a sign-up form with US states and city selector.
Is there already a helper os something that
implements or makes it easier to implement this for Rails.Also when i
select the state all the city appears for that state in the other select
Btw, where could I get a list of US states and US cities? Is there
any webservice for that ? Or just copy and paste from somewhere else?
Don’t do that - the select that you generate is going to be far too
large to be practical. It’s hard to get a clear count of exactly how
many cities are involved, but the best estimate I’ve seen places it
somewhere around 20,000. An autocompleter might help, but you’ll still
have the issue that city data can get stale (new ones are incorporated
frequently). You’d be better served using a geocoder to verify that
addresses actually match an existing DB (Google Maps, etc) and
inquiring with the user if the address doesn’t match. Take a look at
the GeoKit gem.