Take the 2-minute tour ×

I have devise 2.1.2 and cancan 1.6.8 installed.

The current_user helper from devise works fine in my controllers, but is not working the view templates. I'm confused why this is happening. I've been able to use current_user in my view files before.

I tried adding the before_filter authenticate_user! and that didn't help.

Worse comes to worse, I'll add a before filter to the application_controller that says @current_user = current_user but that seems silly.

It's weird that current_user returns nil while user_signed_in? returns true.

Any thoughts on how to get this resolved?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

In the meantime,warden.authenticate(:scope => :user) seems to return the current_user so I'm just going to add that to my application helper.

share|improve this answer
I'm having this exact problem, and am not finding a solution. Your workaround above works, but I was wondering if you ever found a solution to the problem. –  nick Jul 17 '13 at 17:07
I did. I had accidentally made a helper method called current_user that must have been overloading the devise helper. –  Cyrus Jul 18 '13 at 6:56
Thanks for the reply, that was actually my problem too. I was upgrading from rails 2 and was using restful_authentication, which had a user helper that was interfering. –  nick Jul 18 '13 at 15:34
add comment

Your Answer


