diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md index 614f5f2930..849cf45758 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