thoughtbot / clearance

Rails authentication with email & password.

Home | Edit | New

Installation

Installation

Clearance is a Rails engine. It works with versions of Rails greater than 2.3.

In config/environment.rb:

config.gem "thoughtbot-clearance", 
  :lib     => 'clearance', 
  :source  => 'http://gems.github.com', 
  :version => '0.8.2'

Vendor the gem:

rake gems:install
rake gems:unpack

Make sure the development database exists and run the generator:

script/generate clearance

A number of files will be created and instructions will be printed.

You may already have some of these files. Don’t worry. You’ll be asked if you want to overwrite them.

Run the migration:

rake db:migrate

Define a HOST constant in your environment files.
In config/environments/test.rb, config/environments/cucumber.rb (if you’re running cucumber features) and config/environments/development.rb it can be:

HOST = "localhost"

In production.rb it must be the actual host your application is deployed to.
The constant is used by mailers to generate URLs in emails.

In config/environment.rb:

DO_NOT_REPLY = "donotreply@example.com"

Define root_url to something in your config/routes.rb:

map.root :controller => 'home'

Integration with Suspenders

Clearance is in Suspenders If you use it, you already have all the configuration.

Last edited by rgm, Fri Nov 27 13:54:25 -0800 2009
Home | Edit | New
Versions: