I’m working on an file upload page that uses an ajax progress bar
(http://sean.treadway.info/demo/upload/). I’ve also got validation on
the uploads (must be a certain file size/mime type etc). When uploads
pass validation - all is dandy. But when they fail - I can’t work out
how to redisplay the form with the flash error messages (that normally
appear when not using the ajax progress bar).
I’m new to RoR so apologies if i’ve missed something simple. I guess
this has to do with the form being submitted to a hidden iframe? So how
can I display the error messages to the user - in the normal way (i.e.
the flash messages at the top of the form) - after an upload fails
validation. Ideally i’d do a "redirect_to :action => ‘new’ " (instead of
“render”) when the object is not saved but how do I display the flash
messages and keep the form contents filled in this case?