Class: Plutonium::UI::Form::Base::Builder
- Inherits:
-
Builder
- Object
- Builder
- Plutonium::UI::Form::Base::Builder
- Includes:
- Phlexi::Field::Common::Tokens, Options::InferredTypes
- Defined in:
- lib/plutonium/ui/form/base.rb
Instance Method Summary collapse
- #easymde_tag ⇒ Object (also: #markdown_tag)
- #flatpickr_tag ⇒ Object (also: #datetime_tag, #date_tag, #time_tag)
- #int_tel_input_tag ⇒ Object (also: #phone_tag)
- #key_value_store_tag ⇒ Object (also: #hstore_tag, #key_value_tag)
- #resource_select_tag(**attributes) ⇒ Object
- #secure_association_tag(**attributes) ⇒ Object (also: #belongs_to_tag, #has_many_tag, #has_one_tag, #association_tag)
- #secure_polymorphic_association_tag(**attributes) ⇒ Object (also: #polymorphic_belongs_to_tag)
- #slim_select_tag(**attributes) ⇒ Object
- #uppy_tag ⇒ Object (also: #file_tag, #attachment_tag)
Instance Method Details
#easymde_tag ⇒ Object Also known as: markdown_tag
13 14 15 |
# File 'lib/plutonium/ui/form/base.rb', line 13 def easymde_tag(**, &) create_component(Plutonium::UI::Form::Components::Easymde, :easymde, **, &) end |
#flatpickr_tag ⇒ Object Also known as: datetime_tag, date_tag, time_tag
23 24 25 |
# File 'lib/plutonium/ui/form/base.rb', line 23 def flatpickr_tag(**, &) create_component(Components::Flatpickr, :flatpickr, **, &) end |
#int_tel_input_tag ⇒ Object Also known as: phone_tag
27 28 29 |
# File 'lib/plutonium/ui/form/base.rb', line 27 def int_tel_input_tag(**, &) create_component(Components::IntlTelInput, :int_tel_input, **, &) end |
#key_value_store_tag ⇒ Object Also known as: hstore_tag, key_value_tag
38 39 40 |
# File 'lib/plutonium/ui/form/base.rb', line 38 def key_value_store_tag(**, &) create_component(Components::KeyValueStore, :key_value_store, **, &) end |
#resource_select_tag(**attributes) ⇒ Object
42 43 44 |
# File 'lib/plutonium/ui/form/base.rb', line 42 def resource_select_tag(**attributes, &) create_component(Components::ResourceSelect, :select, **attributes, &) end |
#secure_association_tag(**attributes) ⇒ Object Also known as: belongs_to_tag, has_many_tag, has_one_tag, association_tag
46 47 48 49 |
# File 'lib/plutonium/ui/form/base.rb', line 46 def secure_association_tag(**attributes, &) attributes[:data_controller] = tokens(attributes[:data_controller], "slim-select") # TODO: put this behind a config create_component(Components::SecureAssociation, :association, **attributes, &) end |
#secure_polymorphic_association_tag(**attributes) ⇒ Object Also known as: polymorphic_belongs_to_tag
59 60 61 62 |
# File 'lib/plutonium/ui/form/base.rb', line 59 def secure_polymorphic_association_tag(**attributes, &) attributes[:data_controller] = tokens(attributes[:data_controller], "slim-select") # TODO: put this behind a config create_component(Components::SecurePolymorphicAssociation, :polymorphic_association, **attributes, &) end |
#slim_select_tag(**attributes) ⇒ Object
18 19 20 21 |
# File 'lib/plutonium/ui/form/base.rb', line 18 def slim_select_tag(**attributes, &) attributes[:data_controller] = tokens(attributes[:data_controller], "slim-select") select_tag(**attributes, required: false, class!: "", &) end |
#uppy_tag ⇒ Object Also known as: file_tag, attachment_tag
32 33 34 |
# File 'lib/plutonium/ui/form/base.rb', line 32 def uppy_tag(**, &) create_component(Components::Uppy, :uppy, **, &) end |