ruby on rails 3 - How do I keep the current devise session from being destroyed automatically when navigating from page to page? -


I have seen posts about the current_user of devise, but none of them solves my problem. I can access current_user 3 views (ARB files) from my tracks, but can not access it in the controller.

  & lt;% = current_user.name% & gt;   

Works in ARB

  @user = current_user   

does not work in the controller. What am I missing?

--------- Edited ------

I am getting a zero in value as it has come to know that I will be in my index controller < I'm able to use / p>

  @user = current_user   

, but some how once a different action (such as creating) session is deleted.

So the real question is now:

How do I sign in to the current user by going from page to page?

Finally, what was the problem:



Comments