From 435b4666fbfa7314be6f7db874d70c7867018fa9 Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Wed, 2 Dec 2020 10:41:57 -0600 Subject: [PATCH] ActiveStorage Direct Upload docs improvements [ci skip] - Clarifies the wording of step 2 of https://edgeguides.rubyonrails.org/active_storage_overview.html#usage to better reflect what you should do, and to match the code sample immediately after it. - Adds a note about how to use Direct Upload without a FormBuilder. --- guides/source/active_storage_overview.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md index 09f67fb981..e67cfbed8c 100644 --- a/guides/source/active_storage_overview.md +++ b/guides/source/active_storage_overview.md @@ -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 + + ``` 3. Configure CORS on third-party storage services to allow direct upload requests.