diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-03-04 17:24:46 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-03-04 17:24:46 -0300 |
commit | ecf078f0a41b98ecbce3669c6718bd99f833f7d6 (patch) | |
tree | 82deeca352e670035fc581cb6feb4f0db4a9940a /actionview/lib | |
parent | 49618d6f31d453d3cbed8ed2bea6ca491412c272 (diff) | |
parent | 35d12ef3f15184c45b51bfab9b399fe73a7a3ce3 (diff) | |
download | rails-ecf078f0a41b98ecbce3669c6718bd99f833f7d6.tar.gz rails-ecf078f0a41b98ecbce3669c6718bd99f833f7d6.tar.bz2 rails-ecf078f0a41b98ecbce3669c6718bd99f833f7d6.zip |
Merge pull request #19144 from y-yagi/fix_streaming_buffer
fix ActionView::Template::Error when using Streaming with capture.
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/capture_helper.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/capture_helper.rb b/actionview/lib/action_view/helpers/capture_helper.rb index 5a3223968f..a67ba580f1 100644 --- a/actionview/lib/action_view/helpers/capture_helper.rb +++ b/actionview/lib/action_view/helpers/capture_helper.rb @@ -195,7 +195,9 @@ module ActionView def with_output_buffer(buf = nil) #:nodoc: unless buf buf = ActionView::OutputBuffer.new - buf.force_encoding(output_buffer.encoding) if output_buffer + if output_buffer && output_buffer.respond_to?(:encoding) + buf.force_encoding(output_buffer.encoding) + end end self.output_buffer, old_buffer = buf, output_buffer yield |