I used the jQuery File Upload Plugin (https://github.com/blueimp/jQuery-File-Upload) to upload multiple pictures simultaneously in rails. The photo is attached to the Item model, and item is added to a poll.
Using the plugin as:
$(document).ready(function(){
$('#fileupload').fileupload({
url: '/polls',
dataType: "json",
done: function(e,data){
window.location = "/polls/" + data.result.id;
}
}
});
It was expected to call the create action in the Poll Controller for each photo file and redirect the page to show the created poll after all the files were uploaded. However, for instance, when 6 files were chosen to upload, it only displayed 4 photos in the poll page at first. After refreshing the page, it displayed 6 photos. I guessed the issue was ca