Q:

Unable to use render :text with a proc in Rails 4

I am trying to stream data stored on Amazon S3 to a client. Unfortunately, I am unable to redirect to the bucket with a presigned URL in order to support such files as HTML which require the original HTML file to be served from the same domain as its assets (css, etc..). 
After reading http://apidock.com/rails/ActionController/Base/render
It seemed to me as though I should be able to do the following:
 render :text => proc { |response, output|
   s3_object.get(response_target: output)
 end

However, the output of this on the page was just the result of proc.to_s
Similarly, the example provided in the Rails docs:
 render :text => proc { |response, output|
    100.times do |i|
      output.write("This is line #{i}\n")
    end
  }

Seems to do the same.
Has anyone run into this problem? Is there a reason why Rails is not properly rendering the results of the lambda instead of calling .to_s?
Thanks.

A:

As your link suggests this option was available till Rails 2.3.8.
It was deprecated from Rails 3.
Here's an old day discussion showing problems with this feature: https://groups.google.com/forum/#!topic/rubyonrails-core/BnVHfD-yO_I.

