mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-30 03:35:35 +00:00
docs(rails-security): guard the direct-upload route in the example
This commit is contained in:
1 parent
4857f82ff0
commit
0edcf37ff5
1 file changed
+3
-2
@@ -332,8 +332,9 @@ route; apps using direct uploads need a replacement route:
|
||||
|
||||
```ruby
|
||||
get "documents/:id/file", to: "document_files#show", as: :document_file
|
||||
# Re-draw the direct-upload endpoint behind your own authentication.
|
||||
post "uploads", to: "active_storage/direct_uploads#create", as: :rails_direct_uploads
|
||||
constraints ->(req) { req.session[:user_id].present? } do
|
||||
post "uploads", to: "active_storage/direct_uploads#create", as: :rails_direct_uploads
|
||||
end
|
||||
|
||||
class DocumentFilesController < ApplicationController
|
||||
def show
|
||||
|
||||
Reference in new issue
Block a user