Tuesday, September 17, 2013

Uploading file using AJAX in Rails

Paperclip gem can be easily used in your rails application for uploading file. But to make it functional using ajax, we can use remotipart gem which works pretty smoothly with Paperclip gem. Just install the remotipart gem. Prepare your form using Paperclip for uploading file. Then add remote=>true in that form. And your form is ready to upload file using ajax. Implementation details can be found in the following links.

Thursday, September 12, 2013

Attachment in Rails using Paperclip gem

It always requires extra effort to setup your form for uploading files. Paperclip is a wonderful gem which can save your extra effort for that task. Just install the gem, add necessary fields in model including file field, and last of all add multipart => true in your form. Then your application is ready for uploading file. Most of the required options related to uploading file are available in this gem. You can find implementation details in following links.