Class: FlexaFormtasticBootstrap::Inputs::BooleanInput

Inherits:
Formtastic::Inputs::BooleanInput
  • Object
show all
Includes:
Base
Defined in:
lib/flexa_formtastic_bootstrap/inputs/boolean_input.rb,
lib/flexa_formtastic_bootstrap/inputs/OLD_boolean_input.rb

Instance Method Summary collapse

Methods included from FlexaFormtasticBootstrap::Inputs::Base::Wrapping

#clearfix_div_wrapping, #generic_input_wrapping, #inline_inputs_div_wrapping, #input_div_wrapping, #prepended_input_wrapping

Methods included from FlexaFormtasticBootstrap::Inputs::Base::Labelling

#label_html_options

Methods included from FlexaFormtasticBootstrap::Inputs::Base::Html

#input_html_options

Methods included from FlexaFormtasticBootstrap::Inputs::Base::Hints

#hint_html

Methods included from FlexaFormtasticBootstrap::Inputs::Base::Errors

#error_first_html, #error_html, #error_list_html, #error_none_html, #error_sentence_html

Instance Method Details

#empty_labelObject

Need this for formatting to work.



33
34
35
# File 'lib/flexa_formtastic_bootstrap/inputs/boolean_input.rb', line 33

def empty_label
  template.(:label) do end
end

#label_text_with_embedded_checkboxObject



27
28
29
30
# File 'lib/flexa_formtastic_bootstrap/inputs/boolean_input.rb', line 27

def label_text_with_embedded_checkbox
  # That newline matters!  Why, I do no not know.
  check_box_html << "\n" << template.(:span) do label_text end
end

#to_htmlObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/flexa_formtastic_bootstrap/inputs/boolean_input.rb', line 6

def to_html
  
  #options[:boolean][:class] = 'checkbox'
  
  #label_html_options.merge()
  
  clearfix_div_wrapping do
    #empty_label <<
    hidden_field_html <<
    input_div_wrapping(:block) do

          label_with_nested_checkbox
    end
  end
end

#wrapper_html_optionsObject



22
23
24
25
# File 'lib/flexa_formtastic_bootstrap/inputs/boolean_input.rb', line 22

def wrapper_html_options
  new_class = [super[:class], "checkbox"].compact.join(" ")
  super.merge(:class => new_class)
end