Browse files

Tidy up read me for streaming support

  • Loading branch information...
1 parent a4550a7 commit 62f538a709154b4c35914e9adae39f74a8054f01 @mocoso mocoso committed May 24, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4
@@ -26,8 +26,6 @@ docs]( for more details.
### Install as a gem (recommended)
$ gem install csv_builder
-_or for streaming_
- $ gem install csv_streamer
If you are using Bundler then [you know what to do](
@@ -60,8 +58,8 @@ You can set `@csv_options` instance variable to define options for FasterCSV gen
@csv_options = { :force_quotes => true, :col_sep => ';' }
You can optionally stream your results line by line as they are generated. Results will stream if the underlying Rack server supports streaming, otherwise the results will be buffered and sent when the template finishes rendering. Just set `@streaming` to true:
- @streaming = true
+ @streaming = true
You can respond with csv in your controller as well:
@@ -79,6 +77,7 @@ including a snippet like the following in your mailer method
## Streaming Support
Many csv files are quite large, and need to be streamed rather than return in a single shot. Csv stream handling is based on [an epic answer on stackoverflow about rails and streaming.]( Streaming requires configuration of your rails app - you need to use a Rack that supports streaming. I've tested with Unicorn, and created [a separate sample]( project to facilitate testing on Heroku.

0 comments on commit 62f538a

Please sign in to comment.