Class: Pageflow::StorylinesController Private
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Pageflow::StorylinesController
- 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
- #create ⇒ Object private
- #destroy ⇒ Object private
- #order ⇒ Object private
- #scaffold ⇒ Object private
- #update ⇒ Object private
Instance Method Details
#create ⇒ Object
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) (:create, storyline) verify_edit_lock!(entry.to_model) storyline.save respond_with(storyline) end |
#destroy ⇒ Object
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]) (:destroy, storyline) verify_edit_lock!(storyline.entry) storyline.destroy respond_with(storyline) end |
#order ⇒ Object
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]) (: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 |
#scaffold ⇒ Object
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)) (:create, storyline_scaffold.to_model) verify_edit_lock!(entry.to_model) storyline_scaffold.save! respond_with(storyline_scaffold) end |
#update ⇒ Object
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]) (:update, storyline) verify_edit_lock!(storyline.entry) storyline.update(storyline_params) respond_with(storyline) end |