1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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.
This commit is contained in:
Petrik 2021-06-16 14:55:16 +02:00
parent deedcebb4b
commit f12fae3ced

View file

@ -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