Sha256: 07d9c0a9df50649e5c3dde54ab25bbe1bcc0d0c01e933e58ad66dc5b88708211
Contents?: true
Size: 501 Bytes
Versions: 19
Compression:
Stored size: 501 Bytes
Contents
class AttachmentsController < ApplicationController def show attachment = Attachment.find params[:id] send_data attachment.file_data, type: attachment.content_type, filename: attachment.filename, disposition: 'inline' end def upload @attachment = Attachment.find params[:id] @attachment.update(params[:file], current_user) end def destroy @attachment = Attachment.find params[:id] @attachment.destroy render json: {} end end
Version data entries
19 entries across 19 versions & 1 rubygems