From cce3f58e834bf829652fa627b26d860923418686 Mon Sep 17 00:00:00 2001 From: "Carlos A. da Silva" Date: Sun, 18 Oct 2009 18:31:01 -0200 Subject: [PATCH] Fix typo and filter info in readme. --- README.rdoc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.rdoc b/README.rdoc index b7bb8741..3b043d9a 100644 --- a/README.rdoc +++ b/README.rdoc @@ -66,7 +66,7 @@ This line adds devise authenticable automatically for you inside your User class # Include authenticable + recoverable devise :recoverable - # Include authenticable + conformable + recoverable + validatable + # Include authenticable + confirmable + recoverable + validatable devise :confirmable, :recoverable, :validatable # Same as above, include all of them @@ -130,6 +130,10 @@ And to get the current signed in user this helper is available: current_user +You have also access to the session for this scope: + + user_session + Devise let's you setup as many roles as you want, so let's say you already have this User model and also want an Admin model with the same authentication stuff, but not confirmation or password recovery. Just follow the same steps: # Create a migration with the required fields @@ -144,11 +148,12 @@ Devise let's you setup as many roles as you want, so let's say you already have map.devise_for :admin # Inside your protected controller - before_filter :sign_in_admin! + before_filter :authenticate_admin! # Inside your controllers and views admin_signed_in? current_admin + admin_session == TODO