Class: Alchemy::Admin::TrashController

Inherits:
BaseController show all
Defined in:
app/controllers/alchemy/admin/trash_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#leave

Methods included from Modules

included, #module_definition_for, register_module

Methods included from ConfigurationMethods

#configuration, #multi_language?, #multi_site?

Instance Method Details

#clearObject



19
20
21
22
23
# File 'app/controllers/alchemy/admin/trash_controller.rb', line 19

def clear
  @page = Page.find(params[:page_id])
  @elements = Element.trashed
  @elements.map(&:destroy)
end

#indexObject



9
10
11
12
13
14
15
16
17
# File 'app/controllers/alchemy/admin/trash_controller.rb', line 9

def index
  @elements = Element.trashed
  @page = Page.find(params[:page_id])
  @allowed_elements = @page.available_element_definitions
  @draggable_trash_items = {}
  @elements.each do |element|
    @draggable_trash_items["element_#{element.id}"] = element.available_page_cell_names(@page)
  end
end