This project is archived and is in readonly mode.

#5875 ✓resolved
aduffeck

render_to_string :json (or :xml or :update) before render results in DoubleRenderError

Reported by aduffeck | October 28th, 2010 @ 01:22 PM | in 3.x

In Rails3 render_to_string :json => ... (and :xml and :udpate) alters the response_body and thus makes subsequent render calls raise a DoubleRenderError

The following example works in Rails 2.3.8 but doesn't in Rails 3.0.1

class TestController < ApplicationController
  def test
    render :text => render_to_string(:json => "[]")
  end
end

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages