country_state_select 1.0.0 → 1.0.1
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.
- checksums.yaml +8 -8
- data/.travis.yml +13 -0
- data/README.md +6 -1
- data/lib/country_state_select.rb +9 -3
- data/lib/country_state_select/version.rb +1 -1
- data/test/dummy/app/views/users/_form.html.erb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGVhNDNiOGM3ODA0MmE5OGJjZTE1YzA3ZjgyODE2OTdlMTIyZjk3NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2MyZWRhYTJiYzhiNTI3MmQ2NjE5YjQ0NDI4ZDFhMzgyZjJiZGU0Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmIwMmQ2Yzg4ZjE1ZjcwZmY1MGE5NzI1NmYyNGJiYjEyN2FhZTBjZWRlNDNk
|
10
|
+
MGQzMGYwODdiMzk5ODEyZWFiMzcwM2ZjNzdkMmJiZGU1MTZlYTlmOGEzNmIz
|
11
|
+
OWM2ZDVmYzk1ZGZkZTA4NzAyMjAzMDI4ZmEyZmJhOGEzY2E0NzE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzY2ZjVlNzYwZmY5NWRiODYxYWMyOWE5ZTNlYWU0YTdhMzk5ODM3NWU0MzUw
|
14
|
+
NDNkYzM0YmJmN2E3YWI3MDM0MzE0OGEyZjE4MWFjZGI5YTQ3N2JlOWQyOWM5
|
15
|
+
NjhmMWEyMjcwYzNmN2M0NWRmMTRkMDg0ZjdhYmE4NjBmZmYwYjA=
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -5,7 +5,7 @@ Country State Select is library which gives you all the country names and when y
|
|
5
5
|
#Getting Started
|
6
6
|
|
7
7
|
Country State Select is released as a Ruby Gem. The gem is to be installed within a Ruby
|
8
|
-
or Rails application. To install, simply add the following to your Gemfile
|
8
|
+
or Rails application. To install, simply add the following to your Gemfile.
|
9
9
|
|
10
10
|
gem 'country_state_select'
|
11
11
|
|
@@ -39,6 +39,11 @@ Run bundle install and don't forget to restart your server after you install a n
|
|
39
39
|
|
40
40
|
##Version History
|
41
41
|
|
42
|
+
1.0.1
|
43
|
+
|
44
|
+
Added method 'countries_except' inside this can put all the countries which you do not want in to the country select option just you have to fetch countries by
|
45
|
+
CountryStateSelect.countries_except('CountryName1','CountryName2'....)
|
46
|
+
|
42
47
|
1.0.0
|
43
48
|
|
44
49
|
It is the stable version which have all the feature
|
data/lib/country_state_select.rb
CHANGED
@@ -29,9 +29,15 @@ module CountryStateSelect
|
|
29
29
|
INDIAN_STATES.merge(INDIAN_TERRIOTORY).merge(USA_STATE_LIST).merge(CANADIAN_STATES).merge(UK_STATES)
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
#this method will provide the user to opetion to skip any countries in drop down list
|
33
|
+
def self.countries_except(*except)
|
34
|
+
countries = []
|
35
|
+
COUNTRIES.each do |country|
|
36
|
+
countries<< country unless country.in?(except)
|
37
|
+
end
|
38
|
+
return countries
|
34
39
|
end
|
40
|
+
|
35
41
|
end
|
36
42
|
|
37
43
|
case ::Rails.version.to_s
|
@@ -43,4 +49,4 @@ case ::Rails.version.to_s
|
|
43
49
|
require 'country_state_select/railtie'
|
44
50
|
else
|
45
51
|
raise 'Unsupported rails version'
|
46
|
-
end
|
52
|
+
end
|
@@ -21,7 +21,7 @@
|
|
21
21
|
</div>
|
22
22
|
<div class="field">
|
23
23
|
<%= f.label :country_id %><br>
|
24
|
-
<%= f.select :country_name, CountryStateSelect
|
24
|
+
<%= f.select :country_name, CountryStateSelect.countries_except(''), {}, id: 'country_id', :class=>'chosen-select' %>
|
25
25
|
|
26
26
|
</div>
|
27
27
|
<div class="field">
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: country_state_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arvind Vyas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -60,6 +60,7 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- .gitignore
|
63
|
+
- .travis.yml
|
63
64
|
- Gemfile
|
64
65
|
- LICENSE.txt
|
65
66
|
- README.md
|