Class: Locomotive::PageContentController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/locomotive/page_content_controller.rb

Instance Method Summary collapse

Instance Method Details

#editObject


17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/locomotive/page_content_controller.rb', line 17

def edit
  authorize @page

  @section_definitions    = current_site.sections.pluck(:slug, :definition).map { |document|
    { 'type' => document[0] }.merge(document[1])
  }
  @editable_content       = parsing_service.find_all_elements(@page)
  @sections               = @editable_content[:sections]
  @editable_elements      = @editable_content[:elements]
end

#updateObject


28
29
30
31
32
# File 'app/controllers/locomotive/page_content_controller.rb', line 28

def update
  authorize @page

  persisting_service.save(site_params, page_params)
end