remotipart

Remotipart ( + Carrierwave) not uploading files nor using ajax

◇◆丶佛笑我妖孽 提交于 2019-12-12 04:29:02
问题 I've spent a week right now trying to get this to work, reading as much as I can about remotipart, and trying to set it right, but I have failed miserably. I have form which has a title, description, an audio file and an image file. If I submit the form without remote: true it works perfectly, but once I try to upload the form with ajax, it seems like the files are not being uploaded. Since I made the audio file a requirement for posting, I get redirected to the new action, displaying the

Async file uploads with Rails 4

十年热恋 提交于 2019-12-11 22:37:26
问题 I have a form that uses rails jquery-UJS to submit asynchronously. It works fine as long as there is not a file input. When I add a file input, the form stops submitting asynchronously, and instead submits normally (full page reload). I found out that since browsers do not support ajax files, UJS will fire the ajax:aborted:file event if a populated file input exists in the form. http://robots.thoughtbot.com/a-tour-of-rails-jquery-ujs The proposed solution is to use remotipart. https://github