I think I know the answer here already but I figured I would post this to help someone else that comes across this as I can't find this posted anywhere else.
I have a typical Rails model and added a Carrierwave uploader.
When I upload I get this error:
Started POST "/model/2/uploads" for ::1 at 2016-04-23 13:45:23 -0600
Processing by UploadsController#create as JSON
Parameters: {"utf8"=>"✓", "authenticity_token"=>"PPrsIJu4EI5R47VzbfBknaq7QPRpcjsZzCVTkWn2BEEYVc36CQf5rnePTBaVOy6VOX47M4GcrdGCDmH7g8vCQw==", "upload"=>#<ActionDispatch::Http::UploadedFile:0x007fa1b1ea9368 @tempfile=#<Tempfi...
NoMethodError - undefined method `permit' for #<ActionDispatch::Http::UploadedFile:0x007fa1b1ea9368>
It looks like this post:
undefined method `permit' for #<String:0x007f66ec6ff180> ruby on rails
I can't (and I am sure now someone will find it) find it documented anywhere that you need to modify your controller to skip the normal:
def upload_params
# params.require(:upload).permit(:file, :notes)
params.require(:upload)
end
Params security checks when you are uploading via CW (I should note this in the background via JSON).
I am sure I can figure out some conditional here to allow a normal html post but I wanted to confirm I was not missing something more elegant or I was missing a configuration option somewhere.
So to be clear my question(s) are:
1.) In this case am I missing something documented here?
2.) Is there a more elegant solution / secure solution vs a basic check to see if the request was JSON etc.?
UPDATE
Forgot to mention I am also using Dropzone for the uploads.