mirror of
https://github.com/affaan-m/ECC.git
synced 2026-12-01 12:45:15 +09:00
docs(rails-security): add the route for the authorized file controller
This commit is contained in:
1 parent
66a434cbc6
commit
bc2dc43848
1 file changed
+2
@@ -330,6 +330,8 @@ user-scoped files from your own controller that authorizes each request, with
|
||||
`config.active_storage.draw_routes = false`:
|
||||
|
||||
```ruby
|
||||
get "documents/:id/file", to: "document_files#show", as: :document_file
|
||||
|
||||
class DocumentFilesController < ApplicationController
|
||||
def show
|
||||
document = current_user.documents.find(params[:id])
|
||||
|
||||
Reference in new issue
Block a user