Don’t redirect at the end of your for one. No new page will be rendered anyway (the user will just get the download dialog).
Also don’t make things more complicated than they need to be:
@document = Document.find(params[:id])
:filename => @document.filename,
:type => @document.content_type,
:disposition => ‘attachment’)
Peter De Berdt