Closed imgarylai closed 9 years ago
There are several reasons why it might not work:
@imgarylai, did you figure out, what was the problem. I have similar issue.
@nagyt234 I solved this problem in this way:
$(document).on("ready page:load", function () {
$("#new_image").fileupload({
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
maxFileSize: 5000000,
add: function (e, data) {
$.each(data.files, function (index, file) {
data.context = $(tmpl("template-upload", file));
$('#upload-process-status').append(data.context);
data.submit();
});
},
progress: function (e, data) {
if (data.context) {
data.context.each(function () {
var progress = Math.floor(data.loaded / data.total * 70);
$(this).find('.progress-bar').css('width', progress + '%');
});
}
},
done: function (e, data) {
if (data.context) {
data.context.each(function () {
$(this).find('.progress-bar').css('width', 100 + '%');
$(this).fadeOut();
});
}
}
});
});
Hope can help you.
When I updated the gem from 0.4.1 to 0.4.2, this gem doen't work. I downgrade to 0.4.1 and it is work.
It's strange that I didn't get any error messages both in browser console and rails app logs.
Here is my code:
image.js
rails from