Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

Commit

Permalink
Merge pull request #627 from rails/fix-render
Browse files Browse the repository at this point in the history
Do not call response.body to set the body again
  • Loading branch information
Thibaut committed Oct 28, 2015
2 parents 703f8fd + 5da3b96 commit 90d4132
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/turbolinks/redirection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ def render(*args, &block)

if turbolinks
response.content_type = Mime[:js]
end

super(*args, render_options, &block)
render_options = _normalize_render(*args, render_options, &block)
body = render_to_body(render_options)

if turbolinks
self.status = 200
self.response_body = "Turbolinks.replace('#{view_context.j(response.body)}'#{_turbolinks_js_options(options)});"
self.response_body = "Turbolinks.replace('#{view_context.j(body)}'#{_turbolinks_js_options(options)});"
else
super(*args, render_options, &block)
end

self.response_body
Expand Down

0 comments on commit 90d4132

Please sign in to comment.