mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #40731 from ghiculescu/patch-2
ActiveStorage Direct Upload docs improvements [ci skip]
This commit is contained in:
commit
cafdd18721
1 changed files with 7 additions and 1 deletions
|
@ -618,11 +618,17 @@ directly from the client to the cloud.
|
|||
ActiveStorage.start()
|
||||
```
|
||||
|
||||
2. Annotate file inputs with the direct upload URL.
|
||||
2. Add `direct_upload: true` to your [`file_field`](form_helpers.html#uploading-files).
|
||||
|
||||
```erb
|
||||
<%= form.file_field :attachments, multiple: true, direct_upload: true %>
|
||||
```
|
||||
|
||||
If you aren't using a [FormBuilder](form_helpers.html#customizing-form-builders), add the data attribute directly:
|
||||
|
||||
```erb
|
||||
<input type=file data-direct-upload-url="<%= rails_direct_uploads_url %>" />
|
||||
```
|
||||
|
||||
3. Configure CORS on third-party storage services to allow direct upload requests.
|
||||
|
||||
|
|
Loading…
Reference in a new issue