KrisG
KrisG

Reputation: 1111

Ruby Gem for user address location filling from zip/post code

It's quite common these days for site input forms for home address to ask the user for zip/post code and then provide drop down options to the user to select the entire address after having done a lookup from the zip/post code.

Is there a ruby gem or good API to get this functionality integrated into a RoR application?

Upvotes: 1

Views: 724

Answers (1)

rthbound
rthbound

Reputation: 1343

I've had a good experience with Area...

zip = 35205
city, state = zip.to_region(city: true), zip.to_region(state: true) 

I don't know of any libraries with view helpers for generating such a form, you'd have to build it yourself as far as I know. Shouldn't be much trouble.

Upvotes: 2

Related Questions