Skip to content

Commit 507e729

Browse files
committed
Adjust guides to explain the need to disable the ActiveStorage default routes when implementing authenticated routes [ci skip]
1 parent 3c4d217 commit 507e729

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

guides/source/active_storage_overview.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,14 @@ end
674674
<%= image_tag account_logo_path %>
675675
```
676676

677+
And then you might want to disable the Active Storage default routes with:
678+
679+
```ruby
680+
config.active_storage.draw_routes = false
681+
```
682+
683+
to prevent files being accessed with the publicly accessible URLs.
684+
677685
[ActiveStorage::Blobs::RedirectController]: (https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/blobs/redirect_controller.rb)
678686
[ActiveStorage::Representations::RedirectController]: (https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/representations/redirect_controller.rb)
679687

0 commit comments

Comments
 (0)