Class: Katalyst::Content::Editor::Base

Inherits:
Object
  • Object
show all
Defined in:
app/helpers/katalyst/content/editor/base.rb

Direct Known Subclasses

Container, Item, List, NewItem, StatusBar

Constant Summary collapse

CONTAINER_CONTROLLER =
"content--editor--container"
LIST_CONTROLLER =
"content--editor--list"
ITEM_CONTROLLER =
"content--editor--item"
STATUS_BAR_CONTROLLER =
"content--editor--status-bar"
NEW_ITEM_CONTROLLER =
"content--editor--new-item"
TURBO_FRAME =
"content--editor--item-frame"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template, container) ⇒ Base

Returns a new instance of Base.



19
20
21
22
# File 'app/helpers/katalyst/content/editor/base.rb', line 19

def initialize(template, container)
  self.template  = template
  self.container = container
end

Instance Attribute Details

#containerObject

Returns the value of attribute container.



15
16
17
# File 'app/helpers/katalyst/content/editor/base.rb', line 15

def container
  @container
end

#templateObject

Returns the value of attribute template.



15
16
17
# File 'app/helpers/katalyst/content/editor/base.rb', line 15

def template
  @template
end

Instance Method Details

#attributes_scopeObject



28
29
30
# File 'app/helpers/katalyst/content/editor/base.rb', line 28

def attributes_scope
  "#{container.model_name.param_key}[items_attributes][]"
end

#container_form_idObject



24
25
26
# File 'app/helpers/katalyst/content/editor/base.rb', line 24

def container_form_id
  dom_id(container, :items)
end