You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get a new seeds.rb file, just run parse_countries.php.
This will build a seeds file to populate countries and states tables with all countries in the world along with all of their admin 1 regions. These regions correspond to what would be a state within the US. The generated file should be in utf8.
The database model is pretty straightforward:
countries:
id
name
iso #An ISO abbreviation for the country
states:
id
name
country_id #the parent country's id, references an entry in countries.
iso #An ISO abbreviation for the region.
A special thanks to geonames.org for making all of this information available. You can find updated copies of the data files at: