Hello,
I would like to reload a page after sending a file to the user through send_data. So far, I have been unable to figure out how to do this and would greatly appreciate some help.
In my view, I have:
<%= button_to 'Export', { :action => :export_file }, { :onclick => 'JavaScript:location.reload(true);' } %>
In my controller:
def export_file # generate file here send_data(file_data, :filename => 'file.txt') end
This doesn't work properly at all. In Firefox, the file is sent and the page is reloaded but is not rendered (I verified this by looking at the page source before and after). In Internet Explorer, the page does get reloaded but the file is not sent.
Thank you, Jason