Class: Katalyst::Content::Editor::NewItemComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Katalyst::Content::Editor::NewItemComponent
show all
- Includes:
- Turbo::StreamsHelper
- Defined in:
- app/components/katalyst/content/editor/new_item_component.rb
Instance Attribute Summary
#container, #item
Instance Method Summary
collapse
#attributes_scope, #call, #container_form_id, #inspect
Constructor Details
#initialize(item:, container: item.container) ⇒ NewItemComponent
Returns a new instance of NewItemComponent.
11
12
13
|
# File 'app/components/katalyst/content/editor/new_item_component.rb', line 11
def initialize(item:, container: item.container)
super
end
|
Instance Method Details
#item_component ⇒ Object
15
16
17
|
# File 'app/components/katalyst/content/editor/new_item_component.rb', line 15
def item_component(**)
ItemComponent.new(item:, container:, **)
end
|
#item_type ⇒ Object
Also known as:
icon_name
27
28
29
|
# File 'app/components/katalyst/content/editor/new_item_component.rb', line 27
def item_type
item.model_name.param_key
end
|
#label ⇒ Object
23
24
25
|
# File 'app/components/katalyst/content/editor/new_item_component.rb', line 23
def label
t("katalyst.content.editor.new_item.#{item_type}", default: item.model_name.human)
end
|
#row_component ⇒ Object
19
20
21
|
# File 'app/components/katalyst/content/editor/new_item_component.rb', line 19
def row_component(**)
RowComponent.new(item:, container:, **)
end
|