Class: Plutonium::UI::Form::Base::Builder

Inherits:
Builder
  • Object
show all
Includes:
Phlexi::Field::Common::Tokens, Options::InferredTypes
Defined in:
lib/plutonium/ui/form/base.rb

Instance Method Summary collapse

Instance Method Details

#easymde_tagObject Also known as: markdown_tag



18
19
20
# File 'lib/plutonium/ui/form/base.rb', line 18

def easymde_tag(**, &)
  create_component(Plutonium::UI::Form::Components::Easymde, :easymde, **, &)
end

#flatpickr_tagObject Also known as: datetime_tag, date_tag, time_tag



28
29
30
# File 'lib/plutonium/ui/form/base.rb', line 28

def flatpickr_tag(**, &)
  create_component(Components::Flatpickr, :flatpickr, **, &)
end

#int_tel_input_tagObject Also known as: phone_tag



32
33
34
# File 'lib/plutonium/ui/form/base.rb', line 32

def int_tel_input_tag(**, &)
  create_component(Components::IntlTelInput, :int_tel_input, **, &)
end

#key_value_store_tagObject Also known as: hstore_tag, key_value_tag



43
44
45
# File 'lib/plutonium/ui/form/base.rb', line 43

def key_value_store_tag(**, &)
  create_component(Components::KeyValueStore, :key_value_store, **, &)
end

#resource_select_tag(**attributes) ⇒ Object



47
48
49
# File 'lib/plutonium/ui/form/base.rb', line 47

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



51
52
53
54
# File 'lib/plutonium/ui/form/base.rb', line 51

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



64
65
66
67
# File 'lib/plutonium/ui/form/base.rb', line 64

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



23
24
25
26
# File 'lib/plutonium/ui/form/base.rb', line 23

def slim_select_tag(**attributes, &)
  attributes[:data_controller] = tokens(attributes[:data_controller], "slim-select")
  select_tag(**attributes, required: false, class!: "", &)
end

#textarea_tag(**attributes) ⇒ Object Also known as: text_tag, json_tag, jsonb_tag



13
14
15
16
# File 'lib/plutonium/ui/form/base.rb', line 13

def textarea_tag(**attributes, &)
  attributes[:data_controller] = tokens(attributes[:data_controller], "textarea-autogrow")
  super
end

#uppy_tagObject Also known as: file_tag, attachment_tag



37
38
39
# File 'lib/plutonium/ui/form/base.rb', line 37

def uppy_tag(**, &)
  create_component(Components::Uppy, :uppy, **, &)
end