Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

View and model helpers for ISO-3166 country codes.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time


iso_countries - Store countries using ISO-3166 codes

This Rails plugin makes it easy to store ISO-3166 country codes in your database, yet present full country names to your users. This plugin, unlike the repository it forked from, does not localize country names – it's just English.

About ISO-3166

The ISO standards body defines a two-character code and canonical short name for approximately 250 countries. (Don't blame me if you disagree with their list of countries. Some, such as Taiwan, are controversial, and not my fault.)


This plugin has a dependency on the gem iso_country_codes, which provides the actual code/name mappings.

gem install iso_country_codes

Then register the gem in your config/environment.rb and vendor if desired.


class Company < ActiveRecord::Base
  iso_country :country

c = :country => "es"                 # => "es"
c.country_name            # => "Spain"
c.country_name = "France"                 # => "fr"

- form_for @company do |f|
  = f.country_select :country


Copyright © 2009 Jeremy Weiskotten <>. Released under the MIT license.

Something went wrong with that request. Please try again.