country_select 3.0.0 → 5.0.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.
- checksums.yaml +5 -5
- data/.travis.yml +14 -28
- data/CHANGELOG.md +22 -1
- data/Gemfile +0 -6
- data/Gemfile.lock +76 -274
- data/README.md +37 -3
- data/Rakefile +3 -1
- data/country_select.gemspec +7 -9
- data/gemfiles/actionpack.edge.gemfile +0 -6
- data/gemfiles/actionpack.edge.gemfile.lock +73 -280
- data/gemfiles/actionpack5.2.gemfile +6 -0
- data/gemfiles/actionpack5.2.gemfile.lock +106 -0
- data/gemfiles/actionpack6.0.gemfile +6 -0
- data/gemfiles/actionpack6.0.gemfile.lock +108 -0
- data/gemfiles/actionpack6.1.gemfile +6 -0
- data/gemfiles/actionpack6.1.gemfile.lock +107 -0
- data/lib/country_select.rb +1 -6
- data/lib/country_select/formats.rb +1 -1
- data/lib/country_select/tag_helper.rb +17 -2
- data/lib/country_select/version.rb +1 -1
- data/lib/country_select_without_sort_alphabetical.rb +8 -0
- data/spec/country_select_spec.rb +26 -3
- metadata +27 -32
- data/gemfiles/actionpack3.2.gemfile +0 -11
- data/gemfiles/actionpack3.2.gemfile.lock +0 -300
- data/gemfiles/actionpack4.0.gemfile +0 -11
- data/gemfiles/actionpack4.0.gemfile.lock +0 -289
- data/gemfiles/actionpack4.1.gemfile +0 -11
- data/gemfiles/actionpack4.1.gemfile.lock +0 -293
- data/gemfiles/actionpack4.2.gemfile +0 -11
- data/gemfiles/actionpack4.2.gemfile.lock +0 -310
- data/gemfiles/actionpack5.0.gemfile +0 -12
- data/gemfiles/actionpack5.0.gemfile.lock +0 -314
- data/lib/country_select/rails3/country_select_helper.rb +0 -39
@@ -1,39 +0,0 @@
|
|
1
|
-
module ActionView
|
2
|
-
module Helpers
|
3
|
-
class FormBuilder
|
4
|
-
def country_select(method, priority_or_options = {}, options = {}, html_options = {})
|
5
|
-
if Hash === priority_or_options
|
6
|
-
html_options = options
|
7
|
-
options = priority_or_options
|
8
|
-
else
|
9
|
-
options[:priority_countries] = priority_or_options
|
10
|
-
end
|
11
|
-
|
12
|
-
@template.country_select(@object_name, method, objectify_options(options), @default_options.merge(html_options))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
module FormOptionsHelper
|
17
|
-
def country_select(object, method, options = {}, html_options = {})
|
18
|
-
CountrySelect.new(object, method, self, options.delete(:object)).render(options, html_options)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
class CountrySelect < InstanceTag
|
23
|
-
include ::CountrySelect::TagHelper
|
24
|
-
|
25
|
-
def render(options, html_options)
|
26
|
-
@options = options
|
27
|
-
@html_options = html_options
|
28
|
-
|
29
|
-
if self.respond_to?(:select_content_tag)
|
30
|
-
select_content_tag(country_option_tags, @options, @html_options)
|
31
|
-
else
|
32
|
-
html_options = @html_options.stringify_keys
|
33
|
-
add_default_name_and_id(html_options)
|
34
|
-
content_tag(:select, add_options(country_option_tags, options, value(object)), html_options)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|