mirror of
https://github.com/affaan-m/ECC.git
synced 2026-12-01 12:45:15 +09:00
docs(rails-security): note draw_routes removes every default Active Storage route
This commit is contained in:
1 parent
bc2dc43848
commit
577bb2bc3a
1 file changed
+2
-1
@@ -327,7 +327,8 @@ has_one_attached :file, service: :private_documents
|
||||
`rails_blob_url` and `url_for(attachment)` are stable references that never expire; they
|
||||
redirect to a short-lived service URL, so anyone holding one keeps access. Serve
|
||||
user-scoped files from your own controller that authorizes each request, with
|
||||
`config.active_storage.draw_routes = false`:
|
||||
`config.active_storage.draw_routes = false`, which removes every default Active Storage
|
||||
route; apps using direct uploads need a replacement route:
|
||||
|
||||
```ruby
|
||||
get "documents/:id/file", to: "document_files#show", as: :document_file
|
||||
|
||||
Reference in new issue
Block a user