Im building a Rails 3 app, and have an Observer…
in the observer I need to user the current_user var that DEVISE allows me to user across my views…
How can you use the current_user.name or current_user.id in the Observer?
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Create User.current accessor, which sets/reads Thread.current[:user]:
http://rails-bestpractices.com/posts/47-fetch-current-user-in-models