Module: Hyrax::UploadsControllerBehavior

Extended by:
ActiveSupport::Concern
Included in:
UploadsController
Defined in:
app/controllers/concerns/hyrax/uploads_controller_behavior.rb

Instance Method Summary collapse

Instance Method Details

#createObject



8
9
10
11
12
# File 'app/controllers/concerns/hyrax/uploads_controller_behavior.rb', line 8

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

#destroyObject



14
15
16
17
# File 'app/controllers/concerns/hyrax/uploads_controller_behavior.rb', line 14

def destroy
  @upload.destroy
  head :no_content
end