force the download

send_data myGPXCode, :filename => 'fichero.gpx'

You can't actually "force" the browser to do anything, but this gives the proper "suggestions" to the browser to trigger the "save as" dialog...

You are looking for send_file:

-Bill Bob Showalter wrote: