I'll be honest: I don't completely understand the situation. Where is @foo assigned a value?
Also, you might just find that there is better support for
Rails-specific problems (if that ends up being the case) on the
RubyOnRails.org mailing list, rather than here. Or, you can get on IRC
and talk it up on #rubyonrails. You'll find that we mainly deal with
non-Rails stuff.