[Mongrel] Upload Progress and Finishing Up

HH lists at lastonepicked.com
Wed Oct 11 18:40:31 EDT 2006

I posted this on Rick's Beast forum but got zilch so I am gonna try it here:

Ok, I have been fiddling with this trying to integrate it into my app.

I believe I¹m just having a bit of trouble with the last partŠ

In the example, the upload action doesn¹t really return, it renders some
Œtext¹, that basically then invokes a Œcleanup¹ method on the JavaScript.

Well, I want to do a few of my own things when the action finishes so I was
thinking, RJSŠ Well, I¹m having trouble. Basically, the JavaScript is being
rendered as text in the iFrame (Safari 2.0).

I have this code at the end of my upload action:

render :update do |page|

page << "window.parent.UploadProgress.finish();"

page.insert_html :before, 'file_upload_box', :partial =>
'/collection/file_item', :locals => {:file_item => @new_pd_file}

page.visual_effect :fade, "file_item#{@new_pd_file.id}"


The idea is that it calls the JavaScript finish and then it inserts a new TR
in my table, showing the item that was just uploaded. Instead I just see the
rendered JavaScript in the iFrame.

Any ideas why this isn¹t working? What am I doing wrong?

More information about the Mongrel-users mailing list