I am trying to access an instance variable which is set in the controller in the model. The controller is the products controller and the model is the products model. The in
I can't comment directly so I'll post here: the accepted answer does not seem to be right. As @vise notes, class variables are shared across requests. So unless there's just one current account for the entire app, this won't behave as expected.
For more, see the accepted answer by @molf here: Is Rails shared-nothing or can separate requests access the same runtime variables?