Class: Hyrax::UploadsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

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

#destroyObject



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

def destroy
  @upload.destroy
  head :no_content
end