Question

I have understood that the use of session is like using a Hash (more or less). When I use the session I set something like session[:sort] = 'title'. However, the app throws me an exception:

undefined local variable or method `session' for MoviesController:Class

That makes me think that I have to set something before I use session, like initialize it. Any ideas? Thanks!

Was it helpful?

Solution

Are you using session in a class method? You need to use it in an instance method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top