Class: PagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- PagesController
- Defined in:
- app/controllers/pages_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /pages.
-
#destroy ⇒ Object
DELETE /pages/1.
-
#edit ⇒ Object
GET /pages/1/edit.
-
#index ⇒ Object
GET /pages.
-
#new ⇒ Object
GET /pages/new.
-
#show ⇒ Object
GET /pages/1.
-
#update ⇒ Object
PATCH/PUT /pages/1.
Instance Method Details
#create ⇒ Object
POST /pages
24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/pages_controller.rb', line 24 def create @page = Page.new(page_params) if @page.save redirect_to @page, notice: 'Page was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /pages/1
44 45 46 47 |
# File 'app/controllers/pages_controller.rb', line 44 def destroy @page.destroy redirect_to pages_url, notice: 'Page was successfully destroyed.' end |
#edit ⇒ Object
GET /pages/1/edit
20 21 |
# File 'app/controllers/pages_controller.rb', line 20 def edit end |
#index ⇒ Object
GET /pages
6 7 8 |
# File 'app/controllers/pages_controller.rb', line 6 def index @pages = Page.all end |
#new ⇒ Object
GET /pages/new
15 16 17 |
# File 'app/controllers/pages_controller.rb', line 15 def new @page = Page.new end |
#show ⇒ Object
GET /pages/1
11 12 |
# File 'app/controllers/pages_controller.rb', line 11 def show end |
#update ⇒ Object
PATCH/PUT /pages/1
35 36 37 38 39 40 41 |
# File 'app/controllers/pages_controller.rb', line 35 def update if @page.update(page_params) redirect_to @page, notice: 'Page was successfully updated.' else render :edit end end |