clearance 0 Rubygems

Rails authentication with email & password.

h1. Clearance

Rails authentication with email & password.

“We have clearance, Clarence.”:

h2. Wiki

Most information regarding Clearance is on the “Github Wiki”:

h2. Engine

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  => '', 
  :version => '0.6.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.

h2. Environment

Define a HOST constant in your environment files. In config/environments/test.rb 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 = "[email protected]"

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

map.root :controller => 'home'

h2. Cucumber Features

As your app evolves, you want to know that authentication still works. Clearance’s opinion is that you should test its integration with your app using “Cucumber”:

In config/environments/test.rb:

config.gem 'webrat',
  :version => '= 0.4.4'
config.gem 'cucumber',
  :version => '= 0.3.0'
config.gem 'thoughtbot-factory_girl',
  :lib     => 'factory_girl',
  :source  => "", 
  :version => '1.2.1'

Install nokogiri but don’t vendor it (due to its native extensions):

sudo gem install nokogiri

Vendor the gems:

rake gems:install RAILS_ENV=test
rake gems:unpack  RAILS_ENV=test

Run the Cucumber generator (if you haven’t already) and Clearance’s feature generator:

script/generate cucumber
script/generate clearance_features

All of the files generated should be new with the exception of the features/support/paths.rb file. If you have not modified your paths.rb then you will be okay to replace it with this one. If you need to keep your paths.rb file then add these locations in your paths.rb manually:

def path_to(page_name)
  case page_name
  when /the sign up page/i
  when /the sign in page/i
  when /the password reset request page/i

h2. Authors

Clearance was extracted out of “Hoptoad”: We merged the authentication code from two of thoughtbot’s client’s Rails apps. The following people have made significant contributions, suggestions, and generally improved the library. Thank you!

Dan Croak, Mike Burns, Jason Morrison, Joe Ferris, Eugene Bolshakov, Nick Quaranto, Josh Nichols, Mike Breen, Marcel Görner, Bence Nagy, Ben Mabey, Eloy Duran, Tim Pope, Mihai Anca, Mark Cornick, & Shay Arnett.

h2. Questions?

h2. Bugs?

Related Repositories



Rails authentication with email & password. ...



Fork of clearance, not-purely-restful, but with Facebook goodness ...



Login bliss for your Rails application: Thoughtbot's Clearance and JanRain's RPX in one convenient plugin ...



A demo on modifying Clearance to allow login via username ...



A dark color scheme for VIM with bold, bright colors that is nice to your eyes. ...

Top Contributors

croaky eugenebolshakov technicalpickles mike-burns jferris qrush hardbap mjankowski adamlogic jasonm bmabey shayarnett


-   v0.5.5 zip tar
-   v0.4.4 zip tar
-   v0.3.7 zip tar
-   0.5.2 zip tar
-   0.5.1 zip tar
-   0.4.9 zip tar