From: Gregory Brown Date: 2007-04-30T10:57:50+09:00 Subject: Re: Class Level Variables On 4/29/07, Cory Wilkerson wrote: > Cory wrote: > > Alright, I'm missing some core ruby concept here that I just can't > > figure out; any assistance would be excellent and welcome: > > > > Long story short, I'm attempting to modify class level variables @@foo, > > @@bar from an action in a ruby controller (an instance of a given > > controller). > > > > It seems that the class level variables set just fine...however, the > > next time the action is invoked, they're nil again. > > > > Code here: http://rafb.net/p/U3Q9VC20.html > > It just struck me - it likely is a rails issue, I'm running in > development mode and methinks it's likely reloading the class every > single time. > > And - sorry if I seemed snippy, been fighting this for a while. As far as I know, it's a rails issue period. Unless you're storing something in the database(either via sessions or models), you don't have state preservation. I don't know enough about Rails to give you the information you need about that, others on this list do. However, the best place to ask this is certainly the Rails list.