Class: MissionControl::Web::BulmaFormBuilder
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- MissionControl::Web::BulmaFormBuilder
- Defined in:
- lib/mission_control/web/bulma_form_builder.rb
Overview
Instance Method Summary collapse
- #div_control ⇒ Object
- #label_check_box(method, text = nil, options = {}, &block) ⇒ Object
- #label_default(method, text = nil, options = {}, &block) ⇒ Object
- #select(method, choices = nil, options = {}, html_options = {}, &block) ⇒ Object
- #select_with_label(method, choices = nil, options = {}, html_options = {}, &block) ⇒ Object
- #submit(value = nil, options = {}) ⇒ Object
- #submit_primary(value = nil, options = {}) ⇒ Object
- #text_field(method, options = {}) ⇒ Object
Instance Method Details
#div_control ⇒ Object
26 27 28 29 30 |
# File 'lib/mission_control/web/bulma_form_builder.rb', line 26 def div_control @template.content_tag(:div, class: "control") do yield end end |
#label_check_box(method, text = nil, options = {}, &block) ⇒ Object
8 9 10 |
# File 'lib/mission_control/web/bulma_form_builder.rb', line 8 def label_check_box(method, text = nil, = {}, &block) label(method, text, merge_class(, "checkbox"), &block) end |
#label_default(method, text = nil, options = {}, &block) ⇒ Object
4 5 6 |
# File 'lib/mission_control/web/bulma_form_builder.rb', line 4 def label_default(method, text = nil, = {}, &block) label(method, text, merge_class(, "label"), &block) end |
#select(method, choices = nil, options = {}, html_options = {}, &block) ⇒ Object
36 37 38 39 40 |
# File 'lib/mission_control/web/bulma_form_builder.rb', line 36 def select(method, choices = nil, = {}, = {}, &block) label(method, class: "select") do super end end |
#select_with_label(method, choices = nil, options = {}, html_options = {}, &block) ⇒ Object
32 33 34 |
# File 'lib/mission_control/web/bulma_form_builder.rb', line 32 def select_with_label(method, choices = nil, = {}, = {}, &block) label_default(method) + select(method, choices, , , &block) end |
#submit(value = nil, options = {}) ⇒ Object
16 17 18 19 20 |
# File 'lib/mission_control/web/bulma_form_builder.rb', line 16 def submit(value = nil, = {}) div_control do super(value, merge_class(, "button")) end end |
#submit_primary(value = nil, options = {}) ⇒ Object
22 23 24 |
# File 'lib/mission_control/web/bulma_form_builder.rb', line 22 def submit_primary(value = nil, = {}) submit(value, merge_class(, "is-primary")) end |
#text_field(method, options = {}) ⇒ Object
12 13 14 |
# File 'lib/mission_control/web/bulma_form_builder.rb', line 12 def text_field(method, = {}) super(method, merge_class(, "input")) end |