Sha256: 7f8911e0e4618baed42cb6454a8bc9a23ccbebc52c26c3141ee91c85cc119caf
Contents?: true
Size: 510 Bytes
Versions: 20
Compression:
Stored size: 510 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.save_and_destroy render json: {} end end
Version data entries
20 entries across 20 versions & 1 rubygems