I\'m trying to create a view with a download link to download the html source?
You can use render_to_string instead of render, which will give you the page, then to download it use send_data.
render_to_string
send_data
More on render to string here, and more on send_data here.