jquery-fileupload-rails-paperclip-example icon indicating copy to clipboard operation
jquery-fileupload-rails-paperclip-example copied to clipboard

Example breaks against latest gem

Open rschmitty opened this issue 12 years ago • 5 comments

When upgrading to the latest main gem https://github.com/tors/jquery-fileupload-rails the javascript no longer works

Uncaught TypeError: Cannot call method '_adjustMaxNumberOfFiles' of undefined

Reverting to the gem version specified in this example fixes it, I kept all other gem files static

rschmitty avatar Feb 26 '13 00:02 rschmitty

Same here!

Rogerio avatar Mar 01 '13 00:03 Rogerio

@rschmitty - try this. It turned out that all I had to do to get this example working and get rid of that error was changing this line

format.json { render json: [@upload.to_jq_upload].to_json, status: :created, location: @upload }

to:

format.json { render json: {files: [@upload.to_jq_upload]}, status: :created, location: @upload }

And I made the same thing on my app.

Rogerio avatar Mar 01 '13 14:03 Rogerio

ah cool thanks @Rogerio! I'll leave this open so author is aware

rschmitty avatar Mar 02 '13 22:03 rschmitty

I, this change, putting files: [..., resolves the problem after the create, but I still can't see the ready for download files, the ones that we already uploaded. I can see by the log that they are saved, but never showned. I still get the error Uncaught TypeError: Cannot call method '_adjustMaxNumberOfFiles' of undefined.

any ideias?

brunomac avatar Mar 07 '13 14:03 brunomac

https://github.com/tors/jquery-fileupload-rails/issues/30#issuecomment-15956287

klausistblau avatar Apr 05 '13 13:04 klausistblau