i18n_country_select 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +6 -0
- data/lib/i18n_country_select/instance_tag.rb +1 -1
- data/lib/i18n_country_select/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2999baf776b6f61079d920bcef517c3b523f689
|
4
|
+
data.tar.gz: 59ca5160ee2e5e85cf3ca3046b896f897579ef9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f75db348f2c8c9809725b037dd743379cfef62a32db1635d8046031f36e763ebb4fea1cdf3cf0a0bc6adca8143c37f3f8a66123206bc02aa08dd739ae3097662
|
7
|
+
data.tar.gz: fd3266b50babc2a0c6cba07274313785e62321b144111e66bbac8dce192f503eb0ba60200597bc17cd8fe013ce52d5534f823a266dd8828e4dcabbfff117b6d0
|
data/README.rdoc
CHANGED
@@ -26,6 +26,10 @@ Supplying priority countries to be placed at the top of the list:
|
|
26
26
|
|
27
27
|
country_code_select(:user, :country, [[ 'US', 'United States' ], [ 'CA', 'Canada' ]])
|
28
28
|
|
29
|
+
Specifying different selected value:
|
30
|
+
|
31
|
+
country_code_select(:user, :country, [], selected: 'CA')
|
32
|
+
|
29
33
|
|
30
34
|
== Contributors
|
31
35
|
|
@@ -47,10 +51,12 @@ Supplying priority countries to be placed at the top of the list:
|
|
47
51
|
* Adam St. John (https://github.com/astjohn)
|
48
52
|
* Monica Giambitto - https://github.com/nirnaeth
|
49
53
|
* Marat Galiev - https://github.com/maratgaliev
|
54
|
+
* Rachel Carvalho - https://github.com/rachel-carvalho
|
50
55
|
|
51
56
|
Based on the deprecated country_code_select by: Russ Smith (russ@bashme.org) and Frank Wambutt (frank@mo-stud.io)
|
52
57
|
|
53
58
|
== Version History
|
59
|
+
* 1.1.7 - Adding support for default selection
|
54
60
|
* 1.1.6 - Simplifying country code definition
|
55
61
|
* 1.1.5 - Fixing support for Rails 4.2. Adding Kosovo country code
|
56
62
|
* 1.1.4 - Fixed options being ignored when running Rails 4
|
@@ -10,7 +10,7 @@ module I18nCountrySelect
|
|
10
10
|
|
11
11
|
# Adapted from Rails country_select. Just uses country codes instead of full names.
|
12
12
|
def country_code_select(priority_countries, options, html_options)
|
13
|
-
selected = object.
|
13
|
+
selected = options.fetch(:selected, object.respond_to?(@method_name) ? object.send(@method_name) : nil)
|
14
14
|
|
15
15
|
countries = ""
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n_country_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian McQuay (brian@onomojo.com)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|