Class: Manifest::PagesController

Inherits:
ManifestController show all
Defined in:
app/controllers/manifest/pages_controller.rb

Overview

Controls CRUD actions for Page. Only accessible by admin Editors.

Instance Method Summary collapse

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
# File 'app/controllers/manifest/pages_controller.rb', line 19

def create
  @page = Page.new(params[:page])

  if @page.save
    redirect_to manifest_page_path(@page)
  else
    render 'new'
  end
end

#destroyObject



43
44
45
46
47
48
# File 'app/controllers/manifest/pages_controller.rb', line 43

def destroy
  @page = Page.find(params[:id])
  @page.destroy

  redirect_to manifest_pages_path
end

#editObject



29
30
31
# File 'app/controllers/manifest/pages_controller.rb', line 29

def edit
  @page = Page.find(params[:id])
end

#indexObject



7
8
9
# File 'app/controllers/manifest/pages_controller.rb', line 7

def index
  @pages = Page.all
end

#newObject



15
16
17
# File 'app/controllers/manifest/pages_controller.rb', line 15

def new
  @page = Page.new
end

#showObject



11
12
13
# File 'app/controllers/manifest/pages_controller.rb', line 11

def show
  @page = Page.find(params[:id])
end

#updateObject



33
34
35
36
37
38
39
40
41
# File 'app/controllers/manifest/pages_controller.rb', line 33

def update
  @page = Page.find(params[:id])

  if @page.update_attributes(params[:page])
    redirect_to manifest_pages_path
  else
    render 'edit'
  end
end