Reputation: 4728
I know @current_user is instance variable but I am still unclear about the difference between current_user and @current_user ? when should i use current_user and when @current_user ?
Upvotes: 2
Views: 898
Reputation: 4465
current_user
is the helper method provided by devise to access the current user. There is nothing like @current_user
from devise unless you have set it in your code.
Upvotes: 0
Reputation: 26
In my personal experience with devise I never use @current_user, current_user always suffices wherever and whenever I want.
The official documentation only mentions current_user too. Devise Controllers filters and helpers
Upvotes: 1