Sha256: 240db39e601583c52d7c111f6c9b8c2c1b8fc6888c03711e653df68358613f71

Contents?: true

Size: 383 Bytes

Versions: 25

Compression:

Stored size: 383 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  class UploadsController < ApplicationController
    load_and_authorize_resource class: Hyrax::UploadedFile

    def create
      @upload.attributes = { file: params[:files].first,
                             user: current_user }
      @upload.save!
    end

    def destroy
      @upload.destroy
      head :no_content
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/controllers/hyrax/uploads_controller.rb
hyrax-5.0.0 app/controllers/hyrax/uploads_controller.rb
hyrax-5.0.0.rc3 app/controllers/hyrax/uploads_controller.rb
hyrax-5.0.0.rc2 app/controllers/hyrax/uploads_controller.rb
hyrax-5.0.0.rc1 app/controllers/hyrax/uploads_controller.rb
hyrax-3.6.0 app/controllers/hyrax/uploads_controller.rb
hyrax-4.0.0 app/controllers/hyrax/uploads_controller.rb
hyrax-4.0.0.rc3 app/controllers/hyrax/uploads_controller.rb
hyrax-4.0.0.rc2 app/controllers/hyrax/uploads_controller.rb
hyrax-4.0.0.rc1 app/controllers/hyrax/uploads_controller.rb
hyrax-3.5.0 app/controllers/hyrax/uploads_controller.rb
hyrax-4.0.0.beta2 app/controllers/hyrax/uploads_controller.rb
hyrax-3.4.2 app/controllers/hyrax/uploads_controller.rb
hyrax-4.0.0.beta1 app/controllers/hyrax/uploads_controller.rb
hyrax-3.4.1 app/controllers/hyrax/uploads_controller.rb
hyrax-3.4.0 app/controllers/hyrax/uploads_controller.rb
hyrax-3.3.0 app/controllers/hyrax/uploads_controller.rb
hyrax-3.2.0 app/controllers/hyrax/uploads_controller.rb
hyrax-3.1.0 app/controllers/hyrax/uploads_controller.rb
hyrax-3.0.2 app/controllers/hyrax/uploads_controller.rb