@@ -549,9 +549,9 @@ require a higher level of protection consider implementing
549
549
To generate a permanent URL for a blob, you can pass the blob to the
550
550
[`url_for`][ActionView::RoutingUrlFor#url_for] view helper. This generates a
551
551
URL with the blob's [`signed_id`][ActiveStorage::Blob#signed_id]
552
- that is routed to the blob's
553
- [`RedirectController`](ActiveStorage::Blobs::RedirectController).
552
+ that is routed to the blob's [`RedirectController`][ActiveStorage::Blobs::RedirectController]
554
553
554
+ [ActiveStorage::Blobs::RedirectController] : https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/blobs/redirect_controller.rb
555
555
` ` ` ruby
556
556
url_for(user.avatar)
557
557
# => /rails/active_storage/blobs/:signed_id/my-avatar.png
@@ -646,10 +646,10 @@ guess but permanent. Anyone that knows the blob URL will be able to access it,
646
646
even if a `before_action` in your `ApplicationController` would otherwise
647
647
require a login. If your files require a higher level of protection, you can
648
648
implement your own authenticated controllers, based on the
649
- [`ActiveStorage::Blobs::RedirectController`](ActiveStorage::Blobs::RedirectController) ,
650
- [`ActiveStorage::Blobs::ProxyController`](ActiveStorage::Blobs::ProxyController) ,
651
- [`ActiveStorage::Representations::RedirectController`](ActiveStorage::Representations::RedirectController) and
652
- [`ActiveStorage::Representations::ProxyController`](ActiveStorage::Representations::ProxyController)
649
+ [`ActiveStorage::Blobs::RedirectController`][] ,
650
+ [`ActiveStorage::Blobs::ProxyController`][] ,
651
+ [`ActiveStorage::Representations::RedirectController`][] and
652
+ [`ActiveStorage::Representations::ProxyController`][]
653
653
654
654
To only allow an account to access their own logo you could do the following :
655
655
@@ -684,10 +684,10 @@ config.active_storage.draw_routes = false
684
684
685
685
to prevent files being accessed with the publicly accessible URLs.
686
686
687
- [ActiveStorage::Blobs::RedirectController] : ( https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/blobs/redirect_controller.rb)
688
- [ActiveStorage::Blobs::ProxyController] : ( https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/blobs/proxy_controller.rb)
689
- [ActiveStorage::Representations::RedirectController] : ( https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/representations/redirect_controller.rb)
690
- [ActiveStorage::Representations::ProxyController] : ( https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/representations/proxy_controller.rb)
687
+ [` ActiveStorage::Blobs::RedirectController` ] : https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/blobs/redirect_controller.rb
688
+ [` ActiveStorage::Blobs::ProxyController` ] : https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/blobs/proxy_controller.rb
689
+ [` ActiveStorage::Representations::RedirectController` ] : https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/representations/redirect_controller.rb
690
+ [` ActiveStorage::Representations::ProxyController` ] : https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/representations/proxy_controller.rb
691
691
692
692
Downloading Files
693
693
-----------------
0 commit comments