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
11
12
13
14
# File 'app/controllers/hyrax/uploads_controller.rb', line 6

def create
  if params[:id].blank?
    @upload.attributes = { file: params[:files].first,
                           user: current_user }
  else
    upload_with_chunking
  end
  @upload.save!
end

#destroyObject



16
17
18
19
# File 'app/controllers/hyrax/uploads_controller.rb', line 16

def destroy
  @upload.destroy
  head :no_content
end