Module: Ariadne::Forms::Dsl::InputMethods
- Included in:
- ClipboardCopyButton, FormObject, InputGroup, Status
- Defined in:
- lib/ariadne/forms/dsl/input_methods.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#action_menu(**options, &block) ⇒ Object
Adds an <%= link_to_component(Ariadne::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.
- #clipboard_copy_button(**options, &block) ⇒ Object
-
#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.
- #status(**options, &block) ⇒ Object
-
#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(Ariadne::Alpha::ActionMenu) %> to this form.
106 107 108 109 |
# File 'lib/ariadne/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 'lib/ariadne/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.
132 133 134 135 |
# File 'lib/ariadne/forms/dsl/input_methods.rb', line 132 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 'lib/ariadne/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 'lib/ariadne/forms/dsl/input_methods.rb', line 51 def check_box_group(**, &block) add_input(CheckBoxGroupInput.new(builder: builder, form: form, **, &block)) end |
#clipboard_copy_button(**options, &block) ⇒ Object
137 138 139 |
# File 'lib/ariadne/forms/dsl/input_methods.rb', line 137 def (**, &block) add_input(ClipboardCopyButton.new(builder: @builder, form: form, **, &block)) end |
#fields_for(*args, **kwargs, &block) ⇒ Object
Used to render another form object.
12 13 14 |
# File 'lib/ariadne/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 'lib/ariadne/forms/dsl/input_methods.rb', line 27 def hidden(**) add_input(HiddenInput.new(builder: builder, form: form, **)) end |
#inputs ⇒ Object
144 145 146 |
# File 'lib/ariadne/forms/dsl/input_methods.rb', line 144 def inputs @inputs ||= [] end |
#multi(**options, &block) ⇒ Object
Adds a multi input to this form.
20 21 22 |
# File 'lib/ariadne/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 'lib/ariadne/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 'lib/ariadne/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 'lib/ariadne/forms/dsl/input_methods.rb', line 56 def separator add_input(Separator.new) end |
#status(**options, &block) ⇒ Object
124 125 126 |
# File 'lib/ariadne/forms/dsl/input_methods.rb', line 124 def status(**, &block) add_input(Status.new(builder: @builder, form: @form, **, &block)) end |
#submit(**options, &block) ⇒ Object
Adds a submit button to this form.
119 120 121 122 |
# File 'lib/ariadne/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 'lib/ariadne/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 'lib/ariadne/forms/dsl/input_methods.rb', line 66 def text_field(**, &block) = (**) add_input(TextFieldInput.new(builder: builder, form: form, **, &block)) end |