Module: BackboneAXSwitch::BootstrapView
- Included in:
- Sprockets::Helpers::RailsHelper
- Defined in:
- lib/backboneAXSwitch/bootstrap_view.rb
Instance Method Summary collapse
- #bx_cg_switch(label, field_id, options = {}) ⇒ Object
- #bx_field_switch(label, field_id, options = {}) ⇒ Object
Instance Method Details
#bx_cg_switch(label, field_id, options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/backboneAXSwitch/bootstrap_view.rb', line 19 def bx_cg_switch(label, field_id, = {}) bx_cg_group(label, field_id, ) do haml_tag(:div, .merge({class: 'switch', id: field_id})) do haml_tag(:div, {class: 'cb-enable'}) do haml_tag(:span, 'On') end haml_tag(:div, {class: 'cb-disable'}) do haml_tag(:span, 'Off') end haml_tag(:input, .merge({class: 'hide', type: 'checkbox', id: field_id})) end end end |
#bx_field_switch(label, field_id, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/backboneAXSwitch/bootstrap_view.rb', line 4 def bx_field_switch(label, field_id, = {}) capture_haml do haml_tag(:div, .merge({class: 'switch', id: field_id})) do haml_tag(:div, {class: 'cb-enable'}) do haml_tag(:span, 'On') end haml_tag(:div, {class: 'cb-disable'}) do haml_tag(:span, 'Off') end haml_tag(:input, .merge({class: 'hide', type: 'checkbox', id: field_id})) end end end |