开发者

Rendering multiple partials in a controller

开发者 https://www.devze.com 2022-12-21 17:43 出处:网络
I want to render multiple partials in a controller, these will not be part of the response, but pushed to clients via Juggernaut instead.

I want to render multiple partials in a controller, these will not be part of the response, but pushed to clients via Juggernaut instead.

I'm using render_to_string.

When the second one is called, I get a DoubleRenderError.

How do I render a partial the way that performed? wil开发者_开发百科l not be affected?


It turns out render_to_string clears off "render results", so you can call it multiple times. The problem was that I called render_to_string in an after_filter hook, after a render was already called.


wait so how can you do this in a after_filter hook? cause im running into the same issue, and have to do an after_filter hook.

btw, im in a similar situation using push tech, but with HTML 5 websockets, and eventmachine

0

精彩评论

暂无评论...
验证码 换一张
取 消