Rails 3 : Upload image file using AJAX form submission

You can’t upload files over ajax (at least not without using the HTML5 File apis, which you may not be able to rely on). The usual trick is to do the upload in a hidden iframe so that it doesn’t block the ‘main’ page.