country_select 3.0.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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