Class: Pageflow::Editor::WidgetsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/pageflow/editor/widgets_controller.rb

Instance Method Summary collapse

Instance Method Details

#batchObject


16
17
18
19
20
21
22
# File 'app/controllers/pageflow/editor/widgets_controller.rb', line 16

def batch
  subject = find_subject
  authorize!(:edit, subject.to_model)

  subject.widgets.batch_update!(widget_batch_params)
  render(json: {})
end

#indexObject


8
9
10
11
12
13
14
# File 'app/controllers/pageflow/editor/widgets_controller.rb', line 8

def index
  subject = find_subject
  authorize!(:edit, subject.to_model)

  @widgets = subject.widgets.resolve(include_placeholders: true)
  respond_with(@widgets)
end