Class: Locomotive::PagesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Locomotive::PagesController
- Defined in:
- app/controllers/locomotive/pages_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
20 21 22 23 24 |
# File 'app/controllers/locomotive/pages_controller.rb', line 20 def create Page @page = service.create(page_params) respond_with @page, location: -> { edit_content_path(@page) } end |
#destroy ⇒ Object
38 39 40 41 42 |
# File 'app/controllers/locomotive/pages_controller.rb', line 38 def destroy @page service.destroy(@page) respond_with @page, location: edit_content_path(current_site.pages.root.first) end |
#edit ⇒ Object
26 27 28 29 30 |
# File 'app/controllers/locomotive/pages_controller.rb', line 26 def edit @page @page.find_layout respond_with @page end |
#new ⇒ Object
14 15 16 17 18 |
# File 'app/controllers/locomotive/pages_controller.rb', line 14 def new Page @page = current_site.pages.build respond_with @page end |
#sort ⇒ Object
44 45 46 47 48 |
# File 'app/controllers/locomotive/pages_controller.rb', line 44 def sort @page, :update? service.sort(@page, params.require(:children)) respond_with @page, location: edit_page_path(current_site, @page) end |
#update ⇒ Object
32 33 34 35 36 |
# File 'app/controllers/locomotive/pages_controller.rb', line 32 def update @page service.update(@page, page_params) respond_with @page, location: edit_page_path(current_site, @page) end |