Displaying 1 result from an estimated 1 matches for "test_render_first".
2005 Mar 06
1
Force a file download AND render a page
...computer,
and make the link appear on a page rendered for the user. I cannot
figure out how to do both, however. You know "Your download will begin
shortly, if not click _here_"
Relevant controller code:
(this is solely for testing purposes, i will sanitize the path and such
later)
def test_render_first(path)
# send a url to the browser so I can give the user a link in case the
# download doesn''t happen
@download_url = "http://#{@request.env[''SERVER_NAME'']}/#{path}"
render "file/download"
send_file(#{@request.env[''DOCUMENT_ROOT]...