jeremyw / iso_countries forked from koke/iso_countries
- Source
- Commits
- Network (3)
- Downloads (1)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | ||
| |
README.rdoc | ||
| |
Rakefile | ||
| |
init.rb | ||
| |
iso_countries.gemspec | ||
| |
lib/ | ||
| |
tasks/ | Thu Jul 24 08:26:51 -0700 2008 | |
| |
test/ |
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.)
www.iso.org/iso/english_country_names_and_code_elements
Dependencies
This plugin has a dependency on the gem alexrabarts-iso_country_codes, which provides the actual code/name mappings.
gem install alexrabarts-iso_country_codes
Then register the gem in your config/environment.rb and vendor if desired.
Example
class Company < ActiveRecord::Base
iso_country :country
end
c = Company.new :country => "es"
c.country # => "es"
c.country_name # => "Spain"
c.country_name = "France"
c.country # => "fr"
- form_for @company do |f|
= f.iso_country_select :country
License
Copyright © 2009 Jeremy Weiskotten <jeremy@weiskotten.com>. Released under the MIT license.

