RAILS - paperclip don't work with Ajax
i have an application working fine with form_for updloading an image using paperclip.
The problem is, because of the javascript security model, it开发者_JS百科 cannot upload a picture via AJAX.
I would like to know: what is the best approach, that really works with rails 2.3.x, to send file via aJAX using rails? IFRAME technique? swfupload? Any other idea?
VP
The iframe technique is the way to go for AJAX file uploading. I currently just implemented something like this and I followed the tutorial from this page: http://khamsouk.souvanlasy.com/articles/ajax_file_uploads_in_rails_using_attachment_fu_and_responds_to_parent
In the tutorial he uses attachment_fu but the code works just fine with paperclip.
Hope this helps,
Caleb
精彩评论