Class: ActiveStorage::ImgurController

Inherits:
DiskController
  • Object
show all
Defined in:
app/controllers/active_storage/imgur_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



2
3
4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/active_storage/imgur_controller.rb', line 2

def update
  if token = decode_verified_token
    imgur_service.upload token[:key], request.body, checksum: token[:checksum]
    head :no_content
  else
    head :not_found
  end
rescue ActiveStorage::IntegrityError
  head :unprocessable_entity
ensure
  response.stream.close
end