I have a controller with two methods: a and b. Method a initializes variable var.
I open a browser tab and call method a. After opening another tab, I call method b which reads var and I get a nil.
I inspected the console and was quite surprised that the id of the controller object is a different one when calling method b.
Shouldn’t it be the same controller instance with access to variable var inside method b ?
Rails creates a new controller instance for each request. From the documentation:
What are you trying to achieve?