Skip to content

Instantly share code, notes, and snippets.

@sunny0425
Created December 12, 2012 04:01
Show Gist options
  • Save sunny0425/4264769 to your computer and use it in GitHub Desktop.
Save sunny0425/4264769 to your computer and use it in GitHub Desktop.
use geocoder(gem) to find postal code from a city
Geocoder.coordinates("Shanghai, China")
=> [31.230393, 121.473704]
results = Geocoder.search('31.230393, 121.473704')
r = results.first
r.postal_code
@sunny0425
Copy link
Author

奇怪的,居然弄成了匿名gist, 貌似正在改版,原地址(木有样式):https://gist.github.com/4264746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment