Tag Archives: Paperclip

Ruby on Rails + Paperclip + Plupload

After 24 hour of frustation, finally I found solution for multiples uploads using Plupload  and Paperclip.

Plupload send files with params[:file]. Then we need remap the passed params to a new hash.

On upload controller:


class ImagesController < ApplicationController

def create

@gallery = Gallery.find(params[:gallery_id])

@image = @gallery.images.create!({:img => params[:file],  :gallery_id => params[:gallery_id]})

#...

end

References:

http://www.theroamingcoder.com/node/50

https://github.com/moxiecode/plupload/issues/2