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

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

Direct Known Subclasses

Container, Errors, 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.



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

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



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

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

#container_form_idObject



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

def container_form_id
  dom_id(container, :items)
end