country-select 1.0.5 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +13 -6
- data/lib/country-select.rb +7 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -6,11 +6,11 @@ Users are strongly advised to evaluate the suitability of this list given their
|
|
6
6
|
|
7
7
|
## Latest Changes
|
8
8
|
|
9
|
-
|
9
|
+
**1.1.0**
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
- Updated the country list to change the name of *Libyan Arab Jamahiriya* to *Libya* according to the [latest ISO 3166 newsletter](http://www.iso.org/iso/nl_vi-11_name_change_for_libya.pdf)
|
12
|
+
- A country in the priority list will be selected there and not in the main list (thanks to [yyyc514](https://github.com/jamesds/country-select/pull/3))
|
13
|
+
- Removed relics from the pre-gem days
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
@@ -32,9 +32,16 @@ Supplying priority countries to be placed at the top of the list:
|
|
32
32
|
|
33
33
|
country_select("user", "country_name", [ "United Kingdom", "France", "Germany" ])
|
34
34
|
|
35
|
-
##
|
35
|
+
## Version History
|
36
|
+
|
37
|
+
**1.0.5**
|
38
|
+
|
39
|
+
- Runtime error raised if any of the user-supplied priority countries do not correlate with those in the main country list.
|
40
|
+
|
41
|
+
**Note:** this may cause existing applications using country-select to fail, but such failures will highlight incorrect usage, enabling the implementation to be corrected so that correct and accurate data may be gathered.
|
42
|
+
|
43
|
+
Thanks to Steve Purcell (http://github.com/purcell) for this addition.
|
36
44
|
|
37
|
-
- **1.0.5** - runtime error raised if any priority countries do not match those in the main country list
|
38
45
|
- **1.0.4** - updated the country list to match the latest ISO 3166 specification
|
39
46
|
- **1.0.3** - changed gem name from 'iso-3166-country-select' to just 'country-select'
|
40
47
|
- **1.0.2** - forked the plugin and made it into a gem
|
data/lib/country-select.rb
CHANGED
@@ -20,10 +20,16 @@ module ActionView
|
|
20
20
|
end
|
21
21
|
country_options += options_for_select(priority_countries, selected)
|
22
22
|
country_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n"
|
23
|
+
|
24
|
+
# prevents selected from being included twice in the HTML which causes
|
25
|
+
# some browsers to select the second selected option (not priority)
|
26
|
+
# which makes it harder to select an alternative priority country
|
27
|
+
selected = nil if priority_countries.include?(selected)
|
23
28
|
end
|
24
29
|
|
25
30
|
return country_options + options_for_select(COUNTRIES, selected)
|
26
31
|
end
|
32
|
+
|
27
33
|
# All the countries included in the country_options output.
|
28
34
|
COUNTRIES = ["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola",
|
29
35
|
"Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria",
|
@@ -43,7 +49,7 @@ module ActionView
|
|
43
49
|
"Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran, Islamic Republic of", "Iraq",
|
44
50
|
"Ireland", "Isle of Man", "Israel", "Italy", "Jamaica", "Japan", "Jersey", "Jordan", "Kazakhstan", "Kenya",
|
45
51
|
"Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan",
|
46
|
-
"Lao People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "
|
52
|
+
"Lao People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya",
|
47
53
|
"Liechtenstein", "Lithuania", "Luxembourg", "Macao", "Macedonia, The Former Yugoslav Republic Of",
|
48
54
|
"Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique",
|
49
55
|
"Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: country-select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2012-01-06 00:00:00.000000000 +00:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
description: Provides a form helper to insert a country select box using the ISO 3166
|