diff options
author | José Valim <jose.valim@gmail.com> | 2011-04-16 10:28:47 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-04-16 10:28:47 +0200 |
commit | e30ca001efa861cc13259ca8287837174b24e679 (patch) | |
tree | ab47ef08d8c2e8773bb7fc6d6d24cda6cd32bf66 /actionpack/lib/action_view/template.rb | |
parent | 2dd43c3f804176d114cdbfeb8a0f92a43155baee (diff) | |
download | rails-e30ca001efa861cc13259ca8287837174b24e679.tar.gz rails-e30ca001efa861cc13259ca8287837174b24e679.tar.bz2 rails-e30ca001efa861cc13259ca8287837174b24e679.zip |
Yo dawg, I heard you like streaming. So I put a fiber, inside a block, inside a body, so you can stream.
Diffstat (limited to 'actionpack/lib/action_view/template.rb')
-rw-r--r-- | actionpack/lib/action_view/template.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb index 17e549a1c2..6dfc4f68ae 100644 --- a/actionpack/lib/action_view/template.rb +++ b/actionpack/lib/action_view/template.rb @@ -126,6 +126,12 @@ module ActionView @formats = Array.wrap(format).map { |f| f.is_a?(Mime::Type) ? f.ref : f } end + # Returns if the underlying handler supports streaming. If so, + # a streaming buffer *may* be passed when it start rendering. + def supports_streaming? + handler.respond_to?(:supports_streaming?) && handler.supports_streaming? + end + # Render a template. If the template was not compiled yet, it is done # exactly before rendering. # |