2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'app/inputs/foundation_switch_input.rb', line 2
def input
options = input_options
options[:item_wrapper_tag] = false
if options[:labels]
collection = [false, true].zip(options[:labels])
else
collection = [[false, 'No'], [true, 'Yes']]
end
label_method = :last
value_method = :first
html = @builder.send("collection_radio_buttons",
attribute_name, collection, value_method, label_method,
options, input_html_options, &collection_block_for_nested_boolean_style
)
"<div class='switch round'>#{ html }<span></span></div>"
end
|