Class: Admin::TrashController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/trash_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/admin/trash_controller.rb', line 11

def index
  if Gem::Version.new(EffectiveDatatables::VERSION) < Gem::Version.new('3.0')
    @datatable = Effective::Datatables::Trash.new
  else
    @datatable = EffectiveTrashDatatable.new(self)
  end

  @page_title = 'Trash'

  EffectiveTrash.authorized?(self, :index, Effective::Trash)
  EffectiveTrash.authorized?(self, :admin, :effective_trash)
end

#showObject



24
25
26
27
28
29
30
# File 'app/controllers/admin/trash_controller.rb', line 24

def show
  @trash = Effective::Trash.all.find(params[:id])
  @page_title = "Trash item - #{@trash.trashed_to_s}"

  EffectiveTrash.authorized?(self, :show, @trash)
  EffectiveTrash.authorized?(self, :admin, :effective_trash)
end