Skip to content

Commit 40c0a5e

Browse files
authored
Merge pull request rails#42510 from p8/guides/activestorage-redirect-mode
Improve "Serving Files" headings [ci skip]
2 parents f8e45f9 + f12fae3 commit 40c0a5e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

guides/source/active_storage_overview.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,16 +532,19 @@ user.avatar.purge_later
532532
[Attached::One#purge]: https://api.rubyonrails.org/classes/ActiveStorage/Attached/One.html#method-i-purge
533533
[Attached::One#purge_later]: https://api.rubyonrails.org/classes/ActiveStorage/Attached/One.html#method-i-purge_later
534534

535-
Linking to Files
536-
----------------
535+
Serving Files
536+
-------------
537+
538+
Active Storage supports two ways to serve files: redirecting and proxying.
539+
540+
### Redirect mode
537541

538542
To generate a permanent URL for a blob, you can pass the blob to the
539543
[`url_for`][ActionView::RoutingUrlFor#url_for] view helper. This generates a
540544
URL with the blob's [`signed_id`][ActiveStorage::Blob#signed_id]
541545
that is routed to the blob's
542546
[`RedirectController`](ActiveStorage::Blobs::RedirectController).
543547

544-
545548
```ruby
546549
url_for(user.avatar)
547550
# => /rails/active_storage/blobs/:signed_id/my-avatar.png

0 commit comments

Comments
 (0)