Class: Gitlab::FormBuilders::GitlabUiFormBuilder
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- Gitlab::FormBuilders::GitlabUiFormBuilder
- Defined in:
- lib/gitlab/form_builders/gitlab_ui_form_builder.rb
Instance Method Summary collapse
- #gitlab_ui_checkbox_component(method, label = nil, help_text: nil, checkbox_options: {}, checked_value: '1', unchecked_value: '0', label_options: {}, &block) ⇒ Object
- #gitlab_ui_datepicker(method, options = {}) ⇒ Object
- #gitlab_ui_radio_component(method, value, label = nil, help_text: nil, radio_options: {}, label_options: {}, &block) ⇒ Object
- #submit(value = nil, options = {}) ⇒ Object
Instance Method Details
#gitlab_ui_checkbox_component(method, label = nil, help_text: nil, checkbox_options: {}, checked_value: '1', unchecked_value: '0', label_options: {}, &block) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/gitlab/form_builders/gitlab_ui_form_builder.rb', line 20 def gitlab_ui_checkbox_component( method, label = nil, help_text: nil, checkbox_options: {}, checked_value: '1', unchecked_value: '0', label_options: {}, &block ) Pajamas::CheckboxComponent.new( form: self, method: method, label: label, help_text: help_text, checkbox_options: (), checked_value: checked_value, unchecked_value: unchecked_value, label_options: () ).render_in(@template, &block) end |
#gitlab_ui_datepicker(method, options = {}) ⇒ Object
62 63 64 |
# File 'lib/gitlab/form_builders/gitlab_ui_form_builder.rb', line 62 def gitlab_ui_datepicker(method, = {}) @template.text_field @object_name, method, .merge(class: "datepicker form-control gl-form-input") end |
#gitlab_ui_radio_component(method, value, label = nil, help_text: nil, radio_options: {}, label_options: {}, &block) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/gitlab/form_builders/gitlab_ui_form_builder.rb', line 42 def gitlab_ui_radio_component( method, value, label = nil, help_text: nil, radio_options: {}, label_options: {}, &block ) Pajamas::RadioComponent.new( form: self, method: method, value: value, label: label, help_text: help_text, radio_options: (), label_options: () ).render_in(@template, &block) end |
#submit(value = nil, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/gitlab/form_builders/gitlab_ui_form_builder.rb', line 6 def submit(value = nil, = {}) if [:pajamas_button] @template.render Pajamas::ButtonComponent.new( variant: :confirm, type: :submit, button_options: .except(:pajamas_button) ) do value end else super end end |