Class: Paginas::PagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Paginas::PagesController
- Defined in:
- app/controllers/paginas/pages_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #display ⇒ Object
- #edit ⇒ Object
- #featured ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'app/controllers/paginas/pages_controller.rb', line 22 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
37 38 39 40 |
# File 'app/controllers/paginas/pages_controller.rb', line 37 def destroy @page.destroy redirect_to pages_url, notice: 'Page was successfully destroyed.' end |
#display ⇒ Object
15 16 |
# File 'app/controllers/paginas/pages_controller.rb', line 15 def display end |
#edit ⇒ Object
20 21 |
# File 'app/controllers/paginas/pages_controller.rb', line 20 def edit end |
#featured ⇒ Object
9 10 11 12 |
# File 'app/controllers/paginas/pages_controller.rb', line 9 def featured @pages = Page.where(featured: true) render :featured end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/paginas/pages_controller.rb', line 6 def index @pages = Page.all end |
#new ⇒ Object
17 18 19 |
# File 'app/controllers/paginas/pages_controller.rb', line 17 def new @page = Page.new end |
#show ⇒ Object
13 14 |
# File 'app/controllers/paginas/pages_controller.rb', line 13 def show end |
#update ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/controllers/paginas/pages_controller.rb', line 30 def update if @page.update(page_params) redirect_to @page, notice: 'Page was successfully updated.' else render :edit end end |