Class: Admin::Atreides::PagesController

Inherits:
Atreides::AdminController
  • Object
show all
Includes:
Atreides::Extendable
Defined in:
app/controllers/admin/atreides/pages_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



23
24
25
26
27
28
29
# File 'app/controllers/admin/atreides/pages_controller.rb', line 23

def create
  resource.author = current_user
  resource.last_editor = current_user
  super do |success, failure|
    success.html { redirect_to admin_pages_path }
  end
end

#indexObject



3
4
5
6
7
8
9
10
# File 'app/controllers/admin/atreides/pages_controller.rb', line 3

def index
  @list_cols = %w(page state)
  @action_cols = %w(add_child)
  super do |wants|
    wants.html
    wants.js
  end
end

#newObject



18
19
20
21
# File 'app/controllers/admin/atreides/pages_controller.rb', line 18

def new
  resource.parent_id = params[:parent_id].to_i if params[:parent_id]
  super
end

#showObject



12
13
14
15
16
# File 'app/controllers/admin/atreides/pages_controller.rb', line 12

def show
  super do |wants|
    wants.html { redirect_to admin_pages_path }
  end
end

#updateObject



31
32
33
34
35
36
# File 'app/controllers/admin/atreides/pages_controller.rb', line 31

def update
  resource.last_editor = current_user
  super do |success, failure|
    success.html { redirect_to admin_pages_path }
  end
end