10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'app/inputs/radio_with_clear_input.rb', line 10
def input
input_options[:collection_wrapper_tag] ||= options.fetch(:collection_wrapper_tag, SimpleForm.collection_wrapper_tag)
input_options[:item_wrapper_class] ||= 'uc-form-collection-item'
hidden_field = @builder.hidden_field(
attribute_name,
input_html_options.merge(:value => nil).merge(
class: input_html_classes.join(' ')
)
)
label_method, value_method = detect_collection_methods
input_dom = @builder.send(:"collection_#{input_type}_buttons",
attribute_name, collection,
value_method, label_method,
input_options, input_html_options)
dom = " <fieldset class='radio_buttons normal row uc-form-fieldset-radio-with-clear'>\n <div class=\"three fifths small-tablet pad-right\">\n <legend class=\"uc-form-legend\">\#{input_options[:label]}</legend>\n </div>\n <div class='options two fifths small-tablet align-right' data-presents='radio_with_clear'>\n \#{hidden_field}\n \#{input_dom}\n <a href='#'>clear</a>\n </div>\n </fieldset>\n STRING\n dom.html_safe\nend\n"
|