Module: Alchemy::Page::PageCells::ClassMethods

Defined in:
app/models/alchemy/page/page_cells.rb

Instance Method Summary collapse

Instance Method Details

#copy_cells(source, target) ⇒ Array

Copy page cells

Parameters:

Returns:

  • (Array)

19
20
21
22
23
24
25
# File 'app/models/alchemy/page/page_cells.rb', line 19

def copy_cells(source, target)
  new_cells = []
  source.cells.each do |cell|
    new_cells << Cell.create(name: cell.name, page_id: target.id)
  end
  new_cells
end