The Rails way to download a file...

i'm not sure you can - the download is the last thing you need to do in order to make things work. so you show the status page, which then redirects the browser to the download after it has loaded (via a javascript redirect probably), so the user is left with the status page on the screen and a download box.

something like
def download
    if params = correct
       @download = true
       @download = false
       errors.add etc

and then in download.rhtml:
<body <%if @download%>
<%if @download%>
There were errors!

Edwin Moss wrote: