Module: Surveyor::Helpers::FormtasticCustomInput
- Included in:
- SurveyorCheckBoxesInput, SurveyorRadioInput
- Defined in:
- lib/surveyor/helpers/formtastic_custom_input.rb
Instance Method Summary collapse
- #input_html_options_with(choice, response_class) ⇒ Object
- #response_class_to_method(type_sym) ⇒ Object
Instance Method Details
#input_html_options_with(choice, response_class) ⇒ Object
4 5 6 |
# File 'lib/surveyor/helpers/formtastic_custom_input.rb', line 4 def (choice, response_class) .merge((choice)).merge({:id => ([:id] || "answer_id").gsub("answer_id", response_class_to_method(response_class).to_s), :class => [[:class], response_class].join(" ")}) end |
#response_class_to_method(type_sym) ⇒ Object
7 8 9 10 |
# File 'lib/surveyor/helpers/formtastic_custom_input.rb', line 7 def response_class_to_method(type_sym) # doesn't handle response_class == answer, and doesn't have to "#{type_sym.to_s}_value".to_sym end |