I belive that this might help you out:
http://api.rubyonrails.com/classes/ActionController/Streaming.html#M000072