rails_country_select 0.2.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rails_country_select.rb +20 -0
- data/lib/rails_country_select/version.rb +1 -1
- metadata +5 -5
data/lib/rails_country_select.rb
CHANGED
@@ -40,6 +40,26 @@ if defined?(Rails) && defined?(ActionView)
|
|
40
40
|
result
|
41
41
|
end
|
42
42
|
|
43
|
+
#get country name
|
44
|
+
def country_name(options = {:name => "", :num =>"", :alpha2s => "", :alpha3s => ""})
|
45
|
+
country(options)[1]
|
46
|
+
end
|
47
|
+
|
48
|
+
#get country cod
|
49
|
+
def country_cod(options = {:name => "", :num =>"", :alpha2s => "", :alpha3s => ""})
|
50
|
+
country(options)[0]
|
51
|
+
end
|
52
|
+
|
53
|
+
#get country alpha2s
|
54
|
+
def country_alpha2s(options = {:name => "", :num =>"", :alpha2s => "", :alpha3s => ""})
|
55
|
+
country(options)[2]
|
56
|
+
end
|
57
|
+
|
58
|
+
#get country alpha3s
|
59
|
+
def country_alpha3s(options = {:name => "", :num =>"", :alpha2s => "", :alpha3s => ""})
|
60
|
+
country(options)[3]
|
61
|
+
end
|
62
|
+
|
43
63
|
private
|
44
64
|
def translate_countries
|
45
65
|
COUNTRY_ALPHA2S.zip(COUNTRY_NAMES).map do |code, name|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_country_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -76,7 +76,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
76
76
|
version: '0'
|
77
77
|
segments:
|
78
78
|
- 0
|
79
|
-
hash:
|
79
|
+
hash: -1361916533450864319
|
80
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
81
|
none: false
|
82
82
|
requirements:
|
@@ -85,10 +85,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
segments:
|
87
87
|
- 0
|
88
|
-
hash:
|
88
|
+
hash: -1361916533450864319
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project:
|
91
|
-
rubygems_version: 1.8.
|
91
|
+
rubygems_version: 1.8.25
|
92
92
|
signing_key:
|
93
93
|
specification_version: 3
|
94
94
|
summary: Select tag for countries in rails form
|