public
Description: rails plugin to store countries as ISO codes
Homepage:
Clone URL: git://github.com/koke/iso_countries.git
koke (author)
Mon Jan 19 11:01:28 -0800 2009
commit  5ba10b9593879aed31b2a798db92e5d4b99e3096
tree    5a9a1ac95538f5f48ba84006ef6f5b55d3469107
parent  2608a78b1e1440a724577e245f3e54b29f430768
iso_countries / README
100644 31 lines (21 sloc) 0.792 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
= iso_countries - Store countries using ISO 3166 codes
 
This rails plugin enables you to store country info only with the country's ISO-3166 code
 
== 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"
  ISO::Countries.set_language "es"
  c.country_name # => "Francia"
 
  <% form_for @company do |f| %>
    <%= f.iso_country_select :country, [:es, :en] %>
  <% end %>
 
== Acknowledgements
 
Translations are provided by the iso-codes package
http://pkg-isocodes.alioth.debian.org/
 
== License
 
Copyright (c) 2008 Jorge Bernal <jbernal@warp.es>, released under the MIT license