Module: CherrypickFormHelper
- Defined in:
- app/helpers/cherrypick_form_helper.rb
Instance Method Summary collapse
-
#cherrypick_form_group_text(fields, method, label_text, default_text_field_value, options = {}) ⇒ String
Creates a form group specifically for the cherrypick form with a label and a text field.
-
#cherrypick_strategy_radio_button(object_name, method, field_value, label_text, checked: false) ⇒ Object
Create a form group specifically for the cherrypick-strategy radio buttons.
Instance Method Details
#cherrypick_form_group_text(fields, method, label_text, default_text_field_value, options = {}) ⇒ String
Creates a form group specifically for the cherrypick form with a label and a text field
27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/helpers/cherrypick_form_helper.rb', line 27 def cherrypick_form_group_text(fields, method, label_text, default_text_field_value, = {}) content_tag(:div, class: 'form-group form-row') do fields.label(method, label_text, class: 'col-12 col-lg-8 col-form-label') + content_tag(:div, class: 'col-12 col-lg-4') do fields.text_field( method, { value: default_text_field_value, class: 'form-control text-right' }.merge() ) end end end |
#cherrypick_strategy_radio_button(object_name, method, field_value, label_text, checked: false) ⇒ Object
Create a form group specifically for the cherrypick-strategy radio buttons
10 11 12 13 14 15 16 17 |
# File 'app/helpers/cherrypick_form_helper.rb', line 10 def (object_name, method, field_value, label_text, checked: false) content_tag(:div, class: 'form-group form-row') do label_tag("#{object_name}[#{method}]_#{field_value}", label_text, class: 'col-12 col-lg-8 col-form-label') + content_tag(:div, class: 'col-12 col-lg-4') do (object_name, method, field_value, { checked: checked, class: 'form-control text-right' }) end end end |