Sha256: c0817b7621f7097cefd55fce2aa98aaf29b077934ea6720da9ee05d94eafb4c2
Contents?: true
Size: 580 Bytes
Versions: 39
Compression:
Stored size: 580 Bytes
Contents
module Locomotive class ToggleInput < ::SimpleForm::Inputs::Base include Locomotive::SimpleForm::Inputs::FasterTranslate 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 def text(name) I18n.t(name, scope: 'locomotive.inputs.toggle') end end end
Version data entries
39 entries across 39 versions & 1 rubygems