country_select 4.0.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +13 -31
- data/CHANGELOG.md +21 -0
- data/Gemfile +0 -6
- data/Gemfile.lock +63 -265
- data/README.md +15 -2
- data/Rakefile +3 -1
- data/country_select.gemspec +7 -9
- data/gemfiles/actionpack.edge.gemfile +0 -6
- data/gemfiles/actionpack.edge.gemfile.lock +63 -268
- data/gemfiles/actionpack5.2.gemfile +2 -8
- data/gemfiles/actionpack5.2.gemfile.lock +59 -266
- data/gemfiles/actionpack6.0.gemfile +6 -0
- data/gemfiles/actionpack6.0.gemfile.lock +107 -0
- data/gemfiles/actionpack6.1.gemfile +6 -0
- data/gemfiles/actionpack6.1.gemfile.lock +106 -0
- data/lib/country_select.rb +2 -6
- data/lib/country_select/defaults.rb +10 -0
- data/lib/country_select/formats.rb +3 -1
- data/lib/country_select/tag_helper.rb +7 -7
- data/lib/country_select/version.rb +1 -1
- data/lib/country_select_without_sort_alphabetical.rb +2 -6
- data/spec/country_select_spec.rb +43 -3
- metadata +25 -34
- data/gemfiles/actionpack3.2.gemfile +0 -11
- data/gemfiles/actionpack3.2.gemfile.lock +0 -297
- data/gemfiles/actionpack4.0.gemfile +0 -11
- data/gemfiles/actionpack4.0.gemfile.lock +0 -286
- data/gemfiles/actionpack4.1.gemfile +0 -11
- data/gemfiles/actionpack4.1.gemfile.lock +0 -290
- data/gemfiles/actionpack4.2.gemfile +0 -14
- data/gemfiles/actionpack4.2.gemfile.lock +0 -306
- data/gemfiles/actionpack5.0.gemfile +0 -12
- data/gemfiles/actionpack5.0.gemfile.lock +0 -311
- data/gemfiles/actionpack5.1.gemfile +0 -12
- data/gemfiles/actionpack5.1.gemfile.lock +0 -311
- 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
|