Class: Pageflow::Editor::FilesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Pageflow::Editor::FilesController
- Defined in:
- app/controllers/pageflow/editor/files_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/pageflow/editor/files_controller.rb', line 17 def create entry = DraftEntry.find(params[:entry_id]) (:edit, entry.to_model) verify_edit_lock!(entry) @file = entry.create_file(file_type.model, file_params) @file.publish! respond_with(:editor, @file) end |
#index ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'app/controllers/pageflow/editor/files_controller.rb', line 8 def index entry = DraftEntry.find(params[:entry_id]) (:use_files, entry.to_model) @files = entry.files(file_type.model) respond_with(:editor, @files) end |
#retry ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/pageflow/editor/files_controller.rb', line 28 def retry file = file_type.model.find(params[:id]) (:retry, file) verify_edit_lock!(file.entry) file.retry! respond_with(:editor, file, location: editor_file_url(file, collection_name: params[:collection_name])) end |
#update ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'app/controllers/pageflow/editor/files_controller.rb', line 38 def update file = file_type.model.find(params[:id]) (:update, file) verify_edit_lock!(file.entry) file.update_attributes!(update_params) head(:no_content) end |