Forum: Ruby on Rails Double Render Error...

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bradley M. (Guest)
on 2006-05-25 17:48
(Received via mailing list)
I've been fighting with a Double Render Error.

I have some sidebar partials that I render to strings in my
application controller's before_filter:
  @left_sidebar_for_layout = render_to_string(:partial =>
'shared/left_sidebar')

Then in my application layout, I simply add them as a string, like I
would @content_for_layout

This normally works fine.

However, when I put them in via an after_filter (or when using them in
a before_filter with the login engine and access a protected method),
I get a double render error.

Shouldn't I be able to render a partial to a string, regardless of
whether render may have already been performed?

Thanks,
  Brad
This topic is locked and can not be replied to.