Class: S3Relay::UploadsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- S3Relay::UploadsController
- Defined in:
- app/controllers/s3_relay/uploads_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/s3_relay/uploads_controller.rb', line 10 def create @upload = S3Relay::Upload.new(upload_attrs) if @upload.save data = { private_url: @upload.private_url, parent_type: @upload.parent_type, parent_id: @upload.parent_id, user_id: user_attrs[:user_id] } render json: data, status: 201 else render json: { errors: @upload.errors }, status: 422 end end |
#new ⇒ Object
6 7 8 |
# File 'app/controllers/s3_relay/uploads_controller.rb', line 6 def new render json: S3Relay::UploadPresigner.new.form_data end |