Class: Oversee::Field::Form

Inherits:
Oversee::Field show all
Includes:
Phlex::Rails::Helpers::FormWith
Defined in:
app/components/oversee/field/form.rb

Instance Attribute Summary

Attributes inherited from Oversee::Field

#datatype, #key, #resource, #value

Instance Method Summary collapse

Methods inherited from Oversee::Field

#__FORM__, #__INPUT__, #__LABEL__, #__SET__, #__VALUE__, #field_form_id, #field_id, #field_name, #initialize, #resource_class_name

Constructor Details

This class inherits a constructor from Oversee::Field

Instance Method Details

#view_templateObject



4
5
6
7
8
9
10
# File 'app/components/oversee/field/form.rb', line 4

def view_template
  form_with(id: field_form_id, model: resource, url: helpers.update_resource_path(resource_class_name: resource_class_name, id: @resource.id), method: @method, class: "flex items-center w-full gap-4") do |form|
    input type: :hidden, id: "oversee_key", name: "oversee_key", value: @key.to_s
    input type: :hidden, id: "oversee_datatype", name: "oversee_datatype", value: @datatype
    render Oversee::Field::Input.new(key: @key, value: @value, datatype: @datatype, **@options)
  end
end