Permalink
Browse files

Fix requiring devise mapping, and adding some documentation about rou…

…tes and mailer setup.
  • Loading branch information...
carlosantoniodasilva committed Oct 21, 2009
1 parent fcea586 commit 6f450d7a36e4086a8829a8794820099ace9a73b5
Showing with 14 additions and 2 deletions.
  1. +13 −2 README.rdoc
  2. +1 −0 lib/devise.rb
View
@@ -31,10 +31,15 @@ Install warden gem if you don't have it installed (requires 0.5.0 or higher):
sudo gem install warden
-Install devise inside your app:
+Install devise gem:
sudo gem install devise
+Configure warden and devise gems inside your app:
+
+ config.gem 'warden'
+ config.gem 'devise'
+
And you're ready to go.
== Basic Usage
@@ -155,7 +160,13 @@ You have also access to the session for this scope:
user_session
-After signing in a user, confirming it's account or updating it's password, devise will look for a scoped root path to redirect. Example: For a :user resource, it will use user_root_path if it exists, otherwise default root_path will be used.
+After signing in a user, confirming it's account or updating it's password, devise will look for a scoped root path to redirect. Example: For a :user resource, it will use user_root_path if it exists, otherwise default root_path will be used. To do it so, you need to create e default root inside your routes for your application:
+
+ map.root :controller => 'home'
+
+You also need to setup default url options for the mailer, if you are using confirmable or recoverable. It's a Rails required configuration, and you can do this inside your specific environments. Here is an example of development environment:
+
+ config.action_mailer.default_url_options = {:host => 'localhost:3000'}
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:
View
@@ -45,4 +45,5 @@ def #{accessor}
end
require 'devise/warden'
+require 'devise/mapping'
require 'devise/routes'

0 comments on commit 6f450d7

Please sign in to comment.