I have a common failure page that I may need to render to upon failing
some test that occurs in an after_filter method.
I’d like to use the after_filter to take over the control of the
rendering, like so:
some_boolean = my_test
return render(:action => ‘disqualified’) unless some_boolean
@success_controller ||= controller_name
@success_action ||= action_name
return render(:controller => @success_controller, :action =>
In my action, if I do nothing unusual, then I expect to render to the
regular place. If I override @success_controller and/or
@success_action, then my action code can set up the success target.
Unfortunately, when I try to do this, I get a DoubleRenderError, which I
am sure is because the default render is already done in my action
before I attempt to do either render in the after filter.
Can this be done, or do I have to resign myself to only setting the
target in the after_filter, and then doing the rendering in the action