USPS countries list for Rails
Yes, I’m going to be rolling out quite a few Rails plugins for the next few weeks; I’ve got a bit of a backlog.
This one replaces the list of countries used by country_select and other Rails helpers with a list of countries that the United States Postal Service can send mail to. (Yes, it’s hopelessly US-centric, and I know that many countries don’t self-identify as these terms, but it’s not for use by demographers, it’s for use when you need people to specify where they want something mailed via Lance Armstrong’s old team.) The reason I put this together is to make it integrate nicely with the USPS’s shipping quote web service.
Installation
For the svn-happy:
./script/plugin install -x http://svn.codahale.com/usps_countries/trunk
For the Subversionally challenged:
./script/plugin install http://svn.codahale.com/usps_countries/trunk
Usage
This really just replaces the country listings. The one thing you’ll want to know is that the listing for the US can be found here:
USPSCountries::UNITED_STATES
There you go!
3 comments »