Pergunta

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!

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top