Forum: Ruby on Rails Unexpected attribute modification

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bradley M. (Guest)
on 2006-03-12 21:50
(Received via mailing list)
Hi all,

I'm trying to do multiple render_to_string() calls in a method call,
and I'm getting attributes being modified in unexpected ways.

  @left_sidebar = render_to_string( :partial ..... )
  puts    (-> 123456)
  @right_sidebar = render_to_string( :partial .....)
  puts    (-> 234567  WTF!?!?!)
  puts   (-> 345678)

How is @left_sidebar being modified by @right_sidebar= ?

If I do this:

  left = render_to_string(...)
  right = render_to_string(...)
  @left_sidebar = left
  @right_sidebar = right

I seem to be okay.

What am I missing and/or not understanding?

Bradley M.
This topic is locked and can not be replied to.