I'm using render_to_string in an after_filter, which renders a partial
that is sent to a web service. Here's the code:
class MyController < ApplicationController
# show logic
stuff = render_to_string :partial => 'stuff'
I get a DoubleRenderError in the after filter. As I understand it,
the 'show' action will be rendered, but won't be sent to the browser
until the after filter is called. Because the 'show' action is
already rendered (but not sent), we get a DoubleRenderError when
render_to_string is called. Ideally, render_to_string should be
atomic and not mess with current rendering.
The work-around is to just call render_to_string before rendering
'show', but I want to keep my controller code DRY by putting the
webservice logic in an after_filter.
So is this a bug or a feature?