Class: Manifest::PagesController
- Inherits:
-
ManifestController
- Object
- ApplicationController
- ManifestController
- Manifest::PagesController
- Defined in:
- app/controllers/manifest/pages_controller.rb
Overview
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#edit ⇒ Object
29 30 31 |
# File 'app/controllers/manifest/pages_controller.rb', line 29 def edit @page = Page.find(params[:id]) end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/manifest/pages_controller.rb', line 7 def index @pages = Page.all end |
#new ⇒ Object
15 16 17 |
# File 'app/controllers/manifest/pages_controller.rb', line 15 def new @page = Page.new end |
#show ⇒ Object
11 12 13 |
# File 'app/controllers/manifest/pages_controller.rb', line 11 def show @page = Page.find(params[:id]) end |
#update ⇒ Object
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 |