It seems like it should be straightforward, but I'm at a standstill. I have a link to a view controller that ends up using send_data to upload a file to the user's hard drive. This works very well, and it leaves the current view seemingly unaffected.
But now I would like the page to provide some feedback after the download is complete. I naively put something like the following code into the controller before calling the send_data method:
flash[:notice] = "Nice work, hot shot!"
send_data file, :filename=>fullname+".txt", :type=>"text/plain"
But this does not work, because the current view does not restart to give me the ability to display flash var.
I also tried to add an RJS view for this action, but this led to the error of the old DoubleRender, because send_data is also a rendering action.
So ... mm ... how the hell can pass the data back to the current view after running send_data? Or is there a different approach to this problem?
Thank! Aaron.
source
share