views:

15

answers:

0

I have a basic scaffolding that uploads image files with paperclip. I would like to put the upload into a background process.

I created this file:

class UploadWorker < Workling::Base

  def send_file(options)
  end
end

I am not sure how to set this up in the controller

def create

  @image = current_user.images.build(params[:image])
  UploadWorker.async_send_file(params[:image)
  respond_to do |format|
  if @image.save
    flash[:notice] = 'Image was successfully created.'