Can someone please confirm that accessors cannot be used in
ActionController to 'persist' values between requests, at least, not
without persisting to the database?
I'm trying to minimize AJAX calls by storing information from certain
of my calls for use by others later, but my attempts fail. My takeaway
is that instance variables, as set by an accessor, are not stored
between requests.
Can someone please confirm that accessors cannot be used in
ActionController to 'persist' values between requests, at least, not
without persisting to the database?
I'm trying to minimize AJAX calls by storing information from certain
of my calls for use by others later, but my attempts fail. My takeaway
is that instance variables, as set by an accessor, are not stored
between requests.
correct - fresh requests get a new instance of the controller class.
In production the next request could very easily go to a different
rails instance or even a different physical server if your app is
running on several servers.