I want to offer a CSV download of data in my Rails app (eg. An “Export
to Excel” link to grab the current view of tabulated data).
However, I can’t seem to break-out of the Rails framework to output this
non-HTML data. Even if I eliminate my layout template from my view, the
most basic view (no HTML) will still wrap the output in
tags.
Does anyone have a recommended way to do this within Rails?
Thank you!
Matt
–
Matt C. Wagner
Information Security Analyst
Network Intrusion Detection
Security Operations Center
Corporate Information Security
Wells Fargo Bank
Have you tried send_data or send_file which are " Methods for sending
files
and streams to the browser instead of rendering."
I have used send_data to send and image to the browser. Check out my
howto
…