title: How to do a city/state/country code lookup based on zip/country input by the user?
body: <p>Would there be a way to do a city/state/country code lookup based on zip/country input by the user? My site will be international, hence the reason for asking the user to input their country.</p>
  
  <p>I'm thinking the user inputs the zip/post-code and country, which gets saved to the database and then the Google geocode API will convert this to city, state and country and print the output to their user profile. For example:</p>
  
  <p><strong>User input:</strong> </p>
  
  <pre><code>Zip - 92646
  
  Country - USA
  </code></pre>
  
  <p><strong>Output:</strong> </p>
  
  <pre><code>Huntington Beach, CA, USA
  </code></pre>
  
  <p>I could just let the users input their city, state and country, but in the future I want to do some geocoding. So it makes sense to set it up now rather than migrate the database at a later stage. Or do you think I'm doing the wrong thing here? I have a site built in Rails. Thanks in advance.</p>
  
  <p>** Comment: Looks like the demonstration on the <a href="http://www.rubygeocoder.com/" rel="nofollow">RubyCoder</a> Gem allows you to input the zip and country to print the City/State/Country/Zip, which is exactly what I'm after. Thoughts on Geocoder versus Google goecoder API?</p>