Accessing Global Variable

I've not used globals very much, but if each call into a controller is stateless, your global is not surviving. You'd need to write it into session in order to do what you are suggesting.

Peace, Phillip

I've not used globals very much, but if each call into a controller is stateless, your global is not surviving. You'd need to write it into session in order to do what you are suggesting.

Peace, Phillip

Hi Phillip,

Yes, you're absolutely right. Due to the stateless nature of the HTTP protocol, I had to write the array into a session variable.

It's not actually the statelessness of the http protocol: you code
exists in a long running ruby process. However in development mode you
code is reloaded on each request and so your global is reset to
Array.new each time. Regardless a global is a bad thing to use because you've only got one
global but possibly many simultaneous users of your app, so the users
would interfere with each other.

Fred