How to download a file through a controller?

I belive that this might help you out:

http://api.rubyonrails.com/classes/ActionController/Streaming.html#M000072