Class: AttachmentsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- AttachmentsController
- Defined in:
- app/controllers/attachments_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
18 19 20 21 22 23 |
# File 'app/controllers/attachments_controller.rb', line 18 def destroy = Attachment.find params[:id] .save_and_destroy(current_user) render json: {} end |
#show ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'app/controllers/attachments_controller.rb', line 4 def show = Attachment.find params[:id] send_data .file_data, type: .content_type, filename: .filename, disposition: 'inline' end |
#upload ⇒ Object
13 14 15 16 |
# File 'app/controllers/attachments_controller.rb', line 13 def upload = Attachment.find params[:id] .update(params[:file], current_user) end |