Module: Primer::Forms::Dsl::InputMethods
- Included in:
- Alpha::MultiInput, FormObject, InputGroup, MultiInput
- Defined in:
- app/lib/primer/forms/dsl/input_methods.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#action_menu(**options, &block) ⇒ Object
Adds an <%= link_to_component(Primer::Alpha::ActionMenu) %> to this form.
-
#auto_complete(**options, &block) ⇒ Object
Adds an autocomplete text field to this form.
-
#button(**options, &block) ⇒ Object
Adds a (non-submit) button to this form.
-
#check_box(**options, &block) ⇒ Object
Adds a check box to this form.
-
#check_box_group(**options, &block) ⇒ Object
Adds a check box group to this form.
-
#fields_for(*args, **kwargs, &block) ⇒ Object
Used to render another form object.
-
#hidden(**options) ⇒ Object
Adds a hidden input to this form.
- #inputs ⇒ Object
-
#multi(**options, &block) ⇒ Object
Adds a multi input to this form.
-
#radio_button_group(**options, &block) ⇒ Object
Adds a radio button group to this form.
-
#select_list(**options, &block) ⇒ Object
Adds a select list to this form.
-
#separator ⇒ Object
Adds a horizontal separator to the form.
-
#submit(**options, &block) ⇒ Object
Adds a submit button to this form.
-
#text_area(**options, &block) ⇒ Object
Adds a text area to this form.
-
#text_field(**options, &block) ⇒ Object
Adds a text field to this form.
Instance Method Details
#action_menu(**options, &block) ⇒ Object
Adds an <%= link_to_component(Primer::Alpha::ActionMenu) %> to this form.
106 107 108 109 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 106 def (**, &block) = (**) add_input ActionMenuInput.new(builder: builder, form: form, **, &block) end |
#auto_complete(**options, &block) ⇒ Object
Adds an autocomplete text field to this form.
75 76 77 78 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 75 def auto_complete(**, &block) = (**) add_input AutoCompleteInput.new(builder: builder, form: form, **, &block) end |
#button(**options, &block) ⇒ Object
Adds a (non-submit) button to this form.
128 129 130 131 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 128 def (**, &block) = (**) add_input ButtonInput.new(builder: builder, form: form, **, &block) end |
#check_box(**options, &block) ⇒ Object
Adds a check box to this form.
35 36 37 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 35 def check_box(**, &block) add_input CheckBoxInput.new(builder: builder, form: form, **, &block) end |
#check_box_group(**options, &block) ⇒ Object
Adds a check box group to this form.
51 52 53 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 51 def check_box_group(**, &block) add_input CheckBoxGroupInput.new(builder: builder, form: form, **, &block) end |
#fields_for(*args, **kwargs, &block) ⇒ Object
Used to render another form object.
12 13 14 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 12 def fields_for(*args, **kwargs, &block) add_input FormReferenceInput.new(*args, builder: builder, form: form, **kwargs, &block) end |
#hidden(**options) ⇒ Object
Adds a hidden input to this form.
27 28 29 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 27 def hidden(**) add_input HiddenInput.new(builder: builder, form: form, **) end |
#inputs ⇒ Object
136 137 138 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 136 def inputs @inputs ||= [] end |
#multi(**options, &block) ⇒ Object
Adds a multi input to this form.
20 21 22 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 20 def multi(**, &block) add_input MultiInput.new(builder: builder, form: form, **, &block) end |
#radio_button_group(**options, &block) ⇒ Object
Adds a radio button group to this form.
43 44 45 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 43 def (**, &block) add_input RadioButtonGroupInput.new(builder: builder, form: form, **, &block) end |
#select_list(**options, &block) ⇒ Object
Adds a select list to this form.
97 98 99 100 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 97 def select_list(**, &block) = (**) add_input SelectInput.new(builder: builder, form: form, **, &block) end |
#separator ⇒ Object
Adds a horizontal separator to the form.
56 57 58 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 56 def separator add_input Separator.new end |
#submit(**options, &block) ⇒ Object
Adds a submit button to this form.
119 120 121 122 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 119 def submit(**, &block) = (**) add_input SubmitButtonInput.new(builder: builder, form: form, **, &block) end |
#text_area(**options, &block) ⇒ Object
Adds a text area to this form.
84 85 86 87 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 84 def text_area(**, &block) = (**) add_input TextAreaInput.new(builder: builder, form: form, **, &block) end |
#text_field(**options, &block) ⇒ Object
Adds a text field to this form.
66 67 68 69 |
# File 'app/lib/primer/forms/dsl/input_methods.rb', line 66 def text_field(**, &block) = (**) add_input TextFieldInput.new(builder: builder, form: form, **, &block) end |