I'm using "file column" for multiple image uploads. Sometimes it takes
a while for the upload to complete and I would like to provide a tiny
bit of feedback to the user while it's uploading.
Right now I don't need a progress bar. I'm using mongrel so don't even
know it that's possible yet. Instead, I created a simple RJS template
(my first- woo) that says "File uploading, please wait..." with an
animated gif. Created a simple link_to_remote , tested it out, works
great.
Now, when submitting the form, I can't figure out how to call both the
RJS template and the action in my controller. Tried render :action =>
'uploadindicator' in the action itself but get the "Can't have multiple
renders" which makes sense.
Played around with 'submit_remote_tag', with no luck. :loading looks
like it only works with link_to_remote or form_remote_tag.
Any help would be appreciated.
Thanks for the info. I think I'm getting closer.
However, I really do want to render two things. When the files are
uploading (beginning of method), I want to display a message
(Uploading...) and when the files complete (method completes) I want to
display another message (Images successfully uploaded.).
I can't call the rjs directly because I'm uploading files with
":multipart => true" and ajax can't handle files/images.
Played around with a hidden iframe, but can't get around having to
render twice.
So I'm still stumped.
BTW, I had a misprint in my original post. I said that I've tried the
"render :action =>" and meant to say "render :update =>".
Have a look at the plugin here: http://sean.treadway.info/svn/plugins/responds_to_parent/README
It lets your use respond_to_parent and an rjs block to get your rjs to eval in the parent window. This uses the hidden iframe solution and it works well from what i've heard.
Best regards
Peter De Berdt