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}"
end
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?