Shouldn’t Have Done This in Ruby …

@foo = @bar = [ ]

That causes foo and bar to refer to the same Object, and essentially be the same. After I did it in my code, I wondered why @foo and @bar yielded the same values when I iterated through them in my view.

It’s because I tricked myself.

@foo = [ ]
@bar = [ ]

That works like I was expecting. Should have remembered that…

technorati tags:,

Comments are closed.

I'm Reading…
Search This Site

AddThis Feed Button

Need great hosting?

Categories