Class: Locomotive::EditableElementsController

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

Instance Method Summary collapse

Instance Method Details

#indexObject


14
15
16
17
18
19
20
21
22
# File 'app/controllers/locomotive/editable_elements_controller.rb', line 14

def index
  authorize @page

  @editable_elements = parsing_service.find_all_elements(@page)[:elements]

  respond_with(@page) do |format|
    format.html { render_index }
  end
end

#update_allObject


24
25
26
27
28
29
30
31
32
# File 'app/controllers/locomotive/editable_elements_controller.rb', line 24

def update_all
  authorize @page, :update?

  @editable_elements = persisting_service.update_all(page_params[:editable_elements_attributes].values)

  respond_with(@page, notice: t(:notice, scope: 'flash.locomotive.pages.update'), location: editable_elements_path(current_site, @page)) do |format|
    format.html { render_index }
  end
end