I am using multiple file field in a view to upload multiple files. I would like to update the user of progress while uploading. I tried using something like this
def create
params[:upload_data].each do |file|
unless (file =="" or file== nil)
@photo = Photo.create({:approved => false, :user_id => @current_user.id})
@result = "Uploading #{file.original_filename}"
render :update do |page|
page.insert_html(:bottom, 'progress', :partial => 'partials/result')
end
#... perform upload
end
It works fine if I remove the feedback to the user. However it fails with a multiple render error when it is in. I was wondering if anyone knows any way of doing this.
Thank You