From f12fae3ced678da60a46fa79fda6fb02d9000657 Mon Sep 17 00:00:00 2001 From: Petrik Date: Wed, 16 Jun 2021 14:55:16 +0200 Subject: [PATCH] Improve "Serving Files" headings [ci skip] The Active Storage README, uses 'serving' instead of 'linking' files. Serving better describes the section as we don't mention HTML links in the texts. https://github.com/rails/rails/blob/main/activestorage/README.md This also adds a 'Redirect Mode' heading to supplement the 'Proxy Mode' heading. --- guides/source/active_storage_overview.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md index 614f5f2930889..849cf45758469 100644 --- a/guides/source/active_storage_overview.md +++ b/guides/source/active_storage_overview.md @@ -523,8 +523,12 @@ user.avatar.purge_later [Attached::One#purge]: https://api.rubyonrails.org/classes/ActiveStorage/Attached/One.html#method-i-purge [Attached::One#purge_later]: https://api.rubyonrails.org/classes/ActiveStorage/Attached/One.html#method-i-purge_later -Linking to Files ----------------- +Serving Files +------------- + +Active Storage supports two ways to serve files: redirecting and proxying. + +### Redirect mode To generate a permanent URL for a blob, you can pass the blob to the [`url_for`][ActionView::RoutingUrlFor#url_for] view helper. This generates a @@ -532,7 +536,6 @@ URL with the blob's [`signed_id`][ActiveStorage::Blob#signed_id] that is routed to the blob's [`RedirectController`](ActiveStorage::Blobs::RedirectController). - ```ruby url_for(user.avatar) # => /rails/active_storage/blobs/:signed_id/my-avatar.png