Class: FlexaFormtasticBootstrap::Inputs::RadioInput

Inherits:
Formtastic::Inputs::RadioInput
  • Object
show all
Includes:
Base, Base::Choices
Defined in:
lib/flexa_formtastic_bootstrap/inputs/radio_input.rb,
lib/flexa_formtastic_bootstrap/inputs/OLD_radio_input.rb

Instance Method Summary collapse

Methods included from Base::Choices

#choice_label, #choices_group_wrapping, #choices_group_wrapping_html_options, #choices_wrapping_html_options, #input_div_wrapping, #label_html_options

Methods included from Base::Wrapping

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

Methods included from Base::Labelling

#label_html_options

Methods included from Base::Html

#input_html_options

Methods included from Base::Hints

#hint_html

Methods included from Base::Errors

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

Instance Method Details

#choice_html(choice) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/flexa_formtastic_bootstrap/inputs/radio_input.rb', line 22

def choice_html(choice)        
  template.(:label, label_html_options.merge(:for => choice_input_dom_id(choice), :class => nil)) do
    builder.radio_button(input_name, choice_value(choice), input_html_options.merge(choice_html_options(choice)).merge(:required => false)) << 

    choice_label(choice)
  end
end

#legend_htmlObject



30
31
32
33
34
35
36
# File 'lib/flexa_formtastic_bootstrap/inputs/radio_input.rb', line 30

def legend_html
  if render_label?
      template.(:label, label_text,:class => "label_radio")
  else
    "".html_safe
  end
end

#to_htmlObject



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

def to_html
  clearfix_div_wrapping do
    legend_html <<
    input_div_wrapping do
      #choices_group_wrapping do
        collection.map { |choice| 
          #choice_wrapping(choice_wrapping_html_options(choice)) do
            choice_html(choice)
          #end
        }.join("\n").html_safe
      #end
    end
  end
end