Are you using session
in a class method? You need to use it in an instance method.
Using of session in Ruby on Rails
-
04-06-2022 - |
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!
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow