Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Restore response.stream in render_to_string with ActionController::Live #11623
This will work properly by this fix:
class FooController < ActionController::Base include ActionController::Live def streaming response.stream.write "foo\n" # This breaks existing response.stream before render_to_string(text: 'foo') # This will raise IOError because render_to_string re-news `response.stream`, # and it has closed by `ActionController::Live#response_body=` response.stream.write "bar\n" response.stream.close end end
Confirmed this can reproduce at Rails 4.0.0 too.
In 4.0.1 there was still a problem (easily fixed with http://blog.sorah.jp/2013/07/28/render_to_string-in-ac-live though)