Class: Avo::Fields::TiptapField::EditComponent
- Inherits:
-
EditComponent
- Object
- ViewComponent::Base
- BaseComponent
- EditComponent
- Avo::Fields::TiptapField::EditComponent
- Defined in:
- app/components/avo/fields/tiptap_field/edit_component.rb
Constant Summary
Constants included from Concerns::FindAssociationField
Concerns::FindAssociationField::ASSOCIATIONS
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Attributes inherited from EditComponent
#field, #form, #full_width, #index, #kwargs, #multiple, #stacked, #view
Instance Method Summary collapse
-
#initialize(**args) ⇒ EditComponent
constructor
A new instance of EditComponent.
- #resource_id ⇒ Object
- #resource_name ⇒ Object
- #tiptap_id ⇒ Object
Methods inherited from EditComponent
#classes, #disabled?, #field_wrapper_args, #render?
Methods included from ResourcesHelper
#field_wrapper, #filter_wrapper, #index_field_wrapper, #item_selector_data_attributes, #record_path, #record_title, #resource_for_record, #resource_grid, #resource_show_path, #resource_table
Methods inherited from BaseComponent
Methods included from ApplicationHelper
#a_button, #a_link, #body_classes, #button_classes, #chart_color, #container_classes, #d, #decode_filter_params, #e, #editor_file_path, #editor_url, #empty_state, #encode_filter_params, #frame_id, #get_model_class, #input_classes, #mount_path, #number_to_social, #possibly_rails_authentication?, #render_license_warning, #root_path_without_url, #rtl?, #text_direction, #ui, #wrap_in_modal
Methods included from Concerns::FindAssociationField
Constructor Details
#initialize(**args) ⇒ EditComponent
Returns a new instance of EditComponent.
6 7 8 9 10 11 12 |
# File 'app/components/avo/fields/tiptap_field/edit_component.rb', line 6 def initialize(**args) @resource = args[:resource] @resource_id = args[:resource_id] @resource_name = args[:resource_name] super(**args) end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
4 5 6 |
# File 'app/components/avo/fields/tiptap_field/edit_component.rb', line 4 def resource @resource end |
Instance Method Details
#resource_id ⇒ Object
18 19 20 |
# File 'app/components/avo/fields/tiptap_field/edit_component.rb', line 18 def resource_id @resource_id || resource&.record&.id end |
#resource_name ⇒ Object
14 15 16 |
# File 'app/components/avo/fields/tiptap_field/edit_component.rb', line 14 def resource_name @resource_name || resource&.singular_route_key end |
#tiptap_id ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/components/avo/fields/tiptap_field/edit_component.rb', line 22 def tiptap_id if resource_name.present? "tiptap_#{resource_name}_#{@field.id}" elsif form.present? "tiptap_#{form.index}_#{@field.id}" end end |