Because HTTP is a stateless request/response protocol. One request. One
response. You're trying to respond with two things
You could wrap this up in a helper/plugin to hide what's going on, but
this is still going to be the end result
Yeah. Oh well.
Since I've really got data that I want to send (rather than a file), and
I don't want to create a temporary file from it, I instead put it into
the flash. The new URL in the META tag is a controller action that pulls
the data out of flash.now and uses #send_data to create the response.
Works well, except for the ugliness of putting that meta tag in the
layout for this view only...
Change your layout to include this at the top (in the <head> tag):
<%= yield "page_header" %>
Then in your view do this:
<% content_for("page_header") do -%>
<meta http-equiv="REFRESH" content="3; URL=urlgoeshere">
<% end -%>