[LRUG] AJAX file uploads and content types
boss at airbladesoftware.com
Wed Apr 4 01:29:12 PDT 2012
Morning El Rug,
I have a Rails 3.0.11 app which does AJAX file uploads using the remotipart gem . Everything works perfectly in development.
In production I get 406 errors. I'd like to (a) find and fix the problem, and (b) work around it in the meantime.
The basic process is this:
1) User submits a 'remote' form with a file input.
4) My controller action saves the image and responds by rendering create.js.erb.
The problem seems to be at step 3. To gather more information I added `$stderr.puts "useful info"` etc to the remotipart middleware but I can't find the output in my unicorn logs.
Can anyone shed any light on this?
And in the meantime, can anyone tell me how to render my create.js.erb response even if the request wants html? I have tried various permutations in my respond_to block without success.
More information about the Chat