Class: Pageflow::StorylinesController Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#createObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/pageflow/storylines_controller.rb', line 8

def create
  entry = DraftEntry.find(params[:entry_id])
  storyline = entry.storylines.build(storyline_params)

  authorize!(:create, storyline)
  verify_edit_lock!(entry.to_model)
  storyline.save

  respond_with(storyline)
end

#destroyObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



52
53
54
55
56
57
58
59
60
61
# File 'app/controllers/pageflow/storylines_controller.rb', line 52

def destroy
  storyline = Storyline.find(params[:id])

  authorize!(:destroy, storyline)
  verify_edit_lock!(storyline.entry)

  storyline.destroy

  respond_with(storyline)
end

#orderObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



40
41
42
43
44
45
46
47
48
49
50
# File 'app/controllers/pageflow/storylines_controller.rb', line 40

def order
  entry = DraftEntry.find(params[:entry_id])

  authorize!(:edit_outline, entry.to_model)
  verify_edit_lock!(entry)
  params.require(:ids).each_with_index do |id, index|
    entry.storylines.find(id).update(position: index)
  end

  head :no_content
end

#scaffoldObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/pageflow/storylines_controller.rb', line 19

def scaffold
  entry = DraftEntry.find(params[:entry_id])
  storyline_scaffold = StorylineScaffold.build(entry, storyline_params, params.slice(:depth))

  authorize!(:create, storyline_scaffold.to_model)
  verify_edit_lock!(entry.to_model)
  storyline_scaffold.save!

  respond_with(storyline_scaffold)
end

#updateObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



30
31
32
33
34
35
36
37
38
# File 'app/controllers/pageflow/storylines_controller.rb', line 30

def update
  storyline = Storyline.find(params[:id])

  authorize!(:update, storyline)
  verify_edit_lock!(storyline.entry)
  storyline.update(storyline_params)

  respond_with(storyline)
end