geography_helper 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -29,11 +29,12 @@ call `GeographyHelper::Countries.new.countries` for a hash of countries
29
29
  ### The gem also provides two helper methods to render state/province and country dropdowns from a Rails select dropdown.
30
30
 
31
31
  * `country_options_for_select`
32
+ - this method takes an optional selected argument, 'US'
32
33
  * `state_options_for_select()`
33
34
  - this method takes an optional selected argument, 'NY'
34
35
 
35
36
  ``` ruby example.html.erb
36
- <%= form.select :country, country_options_for_select, {include_blank: true} %>
37
+ <%= form.select :country, country_options_for_select('US'), {include_blank: true} %>
37
38
  ```
38
39
 
39
40
  ## Development
@@ -11,9 +11,9 @@ module ActionView
11
11
  grouped_options_for_select(state_and_province_options, selected)
12
12
  end
13
13
 
14
- def country_options_for_select
14
+ def country_options_for_select(selected=nil)
15
15
  geography = GeographyHelper::Countries.new
16
- geography.countries.invert
16
+ options_for_select(geography.countries.invert, selected)
17
17
  end
18
18
  end
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module GeographyHelper
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geography_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-07-04 00:00:00.000000000 Z
12
+ date: 2017-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  segments:
98
98
  - 0
99
- hash: -2610513749692464919
99
+ hash: -387758966814658566
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  none: false
102
102
  requirements:
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  segments:
107
107
  - 0
108
- hash: -2610513749692464919
108
+ hash: -387758966814658566
109
109
  requirements: []
110
110
  rubyforge_project:
111
111
  rubygems_version: 1.8.25