Class: Hyrax::UploadsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/hyrax/uploads_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



6
7
8
9
10
# File 'app/controllers/hyrax/uploads_controller.rb', line 6

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

#destroyObject



12
13
14
15
# File 'app/controllers/hyrax/uploads_controller.rb', line 12

def destroy
  @upload.destroy
  head :no_content
end