Class: SimplePages::PagesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/simple_pages/pages_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



30
31
32
33
# File 'app/controllers/simple_pages/pages_controller.rb', line 30

def create
  @page.save
  respond_with @page
end

#destroyObject



40
41
42
43
# File 'app/controllers/simple_pages/pages_controller.rb', line 40

def destroy
  @page.destroy
  respond_with @page
end

#editObject



27
28
# File 'app/controllers/simple_pages/pages_controller.rb', line 27

def edit
end

#indexObject



13
14
15
16
# File 'app/controllers/simple_pages/pages_controller.rb', line 13

def index
  @pages = @pages.paginate pagination_options
  respond_with @pages
end

#newObject



22
23
24
25
# File 'app/controllers/simple_pages/pages_controller.rb', line 22

def new
  @page.author = session_user
  respond_with @page
end

#showObject



18
19
20
# File 'app/controllers/simple_pages/pages_controller.rb', line 18

def show
  respond_with @page
end

#updateObject



35
36
37
38
# File 'app/controllers/simple_pages/pages_controller.rb', line 35

def update
  @page.update_attributes page_params
  respond_with @page
end