Class: Locomotive::ToggleInput
Instance Method Summary
collapse
#translate_from_namespace
Instance Method Details
6
7
8
9
10
11
12
13
14
15
16
|
# File 'app/inputs/locomotive/toggle_input.rb', line 6
def input(wrapper_options)
template.content_tag(:div, class: 'toggle-wrapper') do
@builder.check_box attribute_name, data: {
'on-text' => text(:on_text),
'off-text' => text(:off_text),
'on-color' => 'success',
'off-color' => 'danger',
'size' => 'small'
}
end
end
|
#text(name) ⇒ Object
18
19
20
|
# File 'app/inputs/locomotive/toggle_input.rb', line 18
def text(name)
I18n.t(name, scope: 'locomotive.inputs.toggle')
end
|