Class: Imhotep::PagesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/imhotep/controllers/pages_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



24
25
26
27
# File 'lib/imhotep/controllers/pages_controller.rb', line 24

def destroy
  resource.destroy
  respond_with(resource)
end

#editObject



14
15
16
# File 'lib/imhotep/controllers/pages_controller.rb', line 14

def edit
  respond_with(resource)
end

#showObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/imhotep/controllers/pages_controller.rb', line 3

def show
  if resource.persisted?
    respond_with(resource)
  else
    respond_to do |format|
      format.html { redirect_to :action => :edit, :path => params[:path], :name => params[:name] }
      format.any  { head :not_found }
    end
  end
end

#updateObject



18
19
20
21
22
# File 'lib/imhotep/controllers/pages_controller.rb', line 18

def update
  resource.attributes = params[:page]
  resource.save
  respond_with(resource, :location => { :action => 'show' })
end