6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/bard/tag_field/form_builder.rb', line 6
def tag_field method, choices = nil, options = {}, html_options = {}, &block
case choices
when Hash
html_options = options
options = choices
choices = nil
when Array
html_options = options if options.is_a?(Hash)
when NilClass
html_options = options
options = {}
end
merged_options = objectify_options(options.merge(html_options))
merged_options[:choices] = choices if choices
Field.new(@object_name, method, @template, merged_options).render(&block)
end
|