Class: SdrViewComponents::TabForm::HiddenFieldsFormComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/sdr_view_components/tab_form/hidden_fields_form_component.rb

Overview

Renders the one real

tag backing a TabListComponent-based tabbed form. Contains only hidden fields -- the tabbed form's visible fields associate with this form via the form HTML attribute (see TabbedFormBuilder), not DOM nesting.

url: is optional and only needed when the model can't derive its own submission url (e.g. it has no resourceful routes).

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseComponent

#args_for, #mark_label_required, #merge_actions, #merge_classes

Constructor Details

#initialize(model:, id:, hidden_fields: [], url: nil) ⇒ HiddenFieldsFormComponent

Returns a new instance of HiddenFieldsFormComponent.



12
13
14
15
16
17
18
# File 'app/components/sdr_view_components/tab_form/hidden_fields_form_component.rb', line 12

def initialize(model:, id:, hidden_fields: [], url: nil)
  @model = model
  @id = id
  @hidden_fields = hidden_fields
  @url = url
  super()
end

Instance Attribute Details

#hidden_fieldsObject (readonly)

Returns the value of attribute hidden_fields.



20
21
22
# File 'app/components/sdr_view_components/tab_form/hidden_fields_form_component.rb', line 20

def hidden_fields
  @hidden_fields
end

#idObject (readonly)

Returns the value of attribute id.



20
21
22
# File 'app/components/sdr_view_components/tab_form/hidden_fields_form_component.rb', line 20

def id
  @id
end

#modelObject (readonly)

Returns the value of attribute model.



20
21
22
# File 'app/components/sdr_view_components/tab_form/hidden_fields_form_component.rb', line 20

def model
  @model
end

#urlObject (readonly)

Returns the value of attribute url.



20
21
22
# File 'app/components/sdr_view_components/tab_form/hidden_fields_form_component.rb', line 20

def url
  @url
end