Class: Avo::Fields::RhinoField::EditComponent
- Inherits:
-
EditComponent
- Object
- EditComponent
- Avo::Fields::RhinoField::EditComponent
- Defined in:
- app/components/avo/fields/rhino_field/edit_component.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #field_id ⇒ Object
-
#initialize(**args) ⇒ EditComponent
constructor
A new instance of EditComponent.
Constructor Details
#initialize(**args) ⇒ EditComponent
Returns a new instance of EditComponent.
6 7 8 9 10 11 12 |
# File 'app/components/avo/fields/rhino_field/edit_component.rb', line 6 def initialize(**args) @resource = args[:resource] @resource_id = args[:resource_id] || @resource&.record&.to_param @resource_name = args[:resource_name] || @resource&.singular_route_key super(**args) end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
4 5 6 |
# File 'app/components/avo/fields/rhino_field/edit_component.rb', line 4 def resource @resource end |
Instance Method Details
#field_id ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/components/avo/fields/rhino_field/edit_component.rb', line 14 def field_id if @resource_name.present? "rhino_#{@resource_name}_#{@field.id}" elsif form.present? "rhino_#{form.index}_#{@field.id}" end end |