in the view file, how can i ,check whether the user is authenticated? is there any helper methods like signed_in?, logged_in? etc. ?
in the view file, how can i ,check whether the user is authenticated? is
Share
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.
No, when using basic http auth you have to manage the session by yourself:
But there are many plugins which provide authentication in rails. Look here for example:
http://www.themomorohoax.com/2009/02/21/rails-2-3-authentication-comparison
(update)
okay, based on your other question, you can just put a before_filter at every controller/method you want to secure. the user will then be prompted for a password the first time he calls a secured method and the browser caches it after that.