country_select 2.5.2 → 5.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +14 -22
- data/CHANGELOG.md +25 -0
- data/Gemfile.lock +98 -82
- data/README.md +36 -2
- data/Rakefile +3 -1
- data/country_select.gemspec +8 -8
- data/gemfiles/actionpack.edge.gemfile +0 -6
- data/gemfiles/actionpack.edge.gemfile.lock +78 -281
- 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 +42 -7
- metadata +29 -32
- data/gemfiles/actionpack3.2.gemfile +0 -11
- data/gemfiles/actionpack3.2.gemfile.lock +0 -293
- data/gemfiles/actionpack4.0.gemfile +0 -11
- data/gemfiles/actionpack4.0.gemfile.lock +0 -282
- data/gemfiles/actionpack4.1.gemfile +0 -11
- data/gemfiles/actionpack4.1.gemfile.lock +0 -286
- data/gemfiles/actionpack4.2.gemfile +0 -12
- data/gemfiles/actionpack4.2.gemfile.lock +0 -310
- 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
|