File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -532,16 +532,19 @@ user.avatar.purge_later
532
532
[Attached::One#purge]: https://api.rubyonrails.org/classes/ActiveStorage/Attached/One.html#method-i-purge
533
533
[Attached::One#purge_later]: https://api.rubyonrails.org/classes/ActiveStorage/Attached/One.html#method-i-purge_later
534
534
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
537
541
538
542
To generate a permanent URL for a blob, you can pass the blob to the
539
543
[`url_for`][ActionView::RoutingUrlFor#url_for] view helper. This generates a
540
544
URL with the blob's [`signed_id`][ActiveStorage::Blob#signed_id]
541
545
that is routed to the blob's
542
546
[`RedirectController`](ActiveStorage::Blobs::RedirectController).
543
547
544
-
545
548
` ` ` ruby
546
549
url_for(user.avatar)
547
550
# => /rails/active_storage/blobs/:signed_id/my-avatar.png
You can’t perform that action at this time.
0 commit comments