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

Version Path
tawork-0.0.24 app/controllers/attachments_controller.rb
tawork-0.0.23 app/controllers/attachments_controller.rb
tawork-0.0.22 app/controllers/attachments_controller.rb
tawork-0.0.21 app/controllers/attachments_controller.rb
tawork-0.0.20 app/controllers/attachments_controller.rb
tawork-0.0.19 app/controllers/attachments_controller.rb
tawork-0.0.18 app/controllers/attachments_controller.rb
tawork-0.0.17 app/controllers/attachments_controller.rb
tawork-0.0.16 app/controllers/attachments_controller.rb
tawork-0.0.15 app/controllers/attachments_controller.rb
tawork-0.0.14 app/controllers/attachments_controller.rb
tawork-0.0.13 app/controllers/attachments_controller.rb
tawork-0.0.12 app/controllers/attachments_controller.rb
tawork-0.0.11 app/controllers/attachments_controller.rb
tawork-0.0.10 app/controllers/attachments_controller.rb
tawork-0.0.9 app/controllers/attachments_controller.rb
tawork-0.0.8 app/controllers/attachments_controller.rb
tawork-0.0.7 app/controllers/attachments_controller.rb
tawork-0.0.6 app/controllers/attachments_controller.rb