Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

version 1.x uses lowercase for country codes #49

Merged
merged 1 commit into from

2 participants

@espen

No description provided.

@scudco
Collaborator

Thanks @espen. The travis build is failing due to the usual bundler timeouts so I'm going to merge this in.

@scudco scudco merged commit b1f3b2a into stefanpenner:master
@espen

Here is a fork of v1 with no downcasing if anyone is interested: https://github.com/espen/country_select

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 17, 2014
  1. @espen
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 3 deletions.
  1. +5 −3 README.md
View
8 README.md
@@ -52,24 +52,26 @@ not available, it will revert to the globally assigned locale (by default, "en")
The locale can be overridden locally:
```ruby
-country_select(:country_name, ['US'], {:iso_codes => true, :locale => 'es'})
+country_select(:country_name, ['us'], {:iso_codes => true, :locale => 'es'})
```
### Using ISO 3166-1 alpha-2 codes as values
You can have the `option` tags use ISO 3166-1 alpha-2 codes as values
and the country names as display strings. For example, the United States
-would appear as `<option value="US">United States</option>`
+would appear as `<option value="us">United States</option>`
If you're starting a new project, this is the recommended way to store
your country data since it will be more resistant to country names
changing.
+Beware that version 1.x converts all codes to lowercase ('us' instead of 'US'). Version 2.x will as per ISO 3166 use uppercase for all codes.
+
```ruby
country_select("user", "country_code", nil, iso_codes: true)
```
```ruby
-country_select("user", "country_code", [ "GB", "FR", "DE" ], iso_codes: true)
+country_select("user", "country_code", [ "gb", "fr", "de" ], iso_codes: true)
```
#### Global configuration to always use ISO codes
Something went wrong with that request. Please try again.