Topic: Refresh required to complete controller action (save file)

Hi there,I am fairly new to rails but have been developing an app which requires a .csv file to be downloaded. Rails version 3.2.8 and ruby 1.9.3. Using Google chrome with the local rails development server.I'm following the railscast here: … =asciicast but I'm using jquery mobile, so it may be something related to jquery mobile.

My problem: when I use the render text method ( render text: @products.to_csv), the first page loaded says "Undefined".  If I look at the source code, all my data is there.  I have to reload the page to get it to show up correctly.

If I switch to try to download the data via (  send_data csv, :filename => 'Connections.csv' ), the first page doesn't show anything.  A reload successfully downloads the file.

The only other time I've seen this happen is when I switch from the mobile site to the full site.  Sometimes a reload is required to actually make the switch.  Any ideas about why this is happening?

Last edited by mace_turbo (2012-12-27 01:59:21)