Вопрос

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!

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top