class FormtasticBootstrap::Inputs::BooleanInput

Public Instance Methods

checkbox_wrapping(&block) click to toggle source
# File lib/formtastic-bootstrap/inputs/boolean_input.rb, line 31
def checkbox_wrapping(&block)
  template.content_tag(:div,
    template.capture(&block).html_safe,
    wrapper_html_options
  )
end
hidden_field_html() click to toggle source
# File lib/formtastic-bootstrap/inputs/boolean_input.rb, line 19
def hidden_field_html
  template.hidden_field_tag(input_html_options[:name], unchecked_value, :id => nil, :disabled => input_html_options[:disabled] )
end
label_with_nested_checkbox() click to toggle source
# File lib/formtastic-bootstrap/inputs/boolean_input.rb, line 23
def label_with_nested_checkbox
  builder.label(
    method,
    label_text_with_embedded_checkbox,
    label_html_options
  )
end
render_label?() click to toggle source

Skip rendering of .form-label in bootstrap_wrapping

# File lib/formtastic-bootstrap/inputs/boolean_input.rb, line 8
def render_label?
  false
end
to_html() click to toggle source
# File lib/formtastic-bootstrap/inputs/boolean_input.rb, line 12
def to_html
  bootstrap_wrapping do
    hidden_field_html <<
    label_with_nested_checkbox
  end
end
wrapper_html_options() click to toggle source
Calls superclass method
# File lib/formtastic-bootstrap/inputs/boolean_input.rb, line 38
def wrapper_html_options
  super.tap do |options|
    options[:class] = (options[:class].split + ["checkbox"]).join(" ")
  end
end