trap_door icon indicating copy to clipboard operation
trap_door copied to clipboard

Reverse Captcha for your Rails app

h1. This repository was for Rails 2.x and is no longer actively maintained. The Rails 4.x version can be found "here.":https://github.com/Silex/trap_door

h1. Trap Door - Reverse Captcha for Rails

Unobtrusive Captcha for your Rails forms. Trap Door works by adding a hidden "honeypot" field to your forms that only a spam bot will fill out. A before filter checks for the presence of this field and banishes bots to a "spam trap":http://en.wikipedia.org/wiki/User:Mike_Rosoft/Spambot.

h2. Installation

@script/plugin install git://github.com/hardbap/trap_door.git@

h2. Using Trap Door

h3. In your view


    
        
        
        # the rest of your form...

h3. In your controller


    class PostController  :create
        
        # the rest of your controller...

h2. Configuration

By default Trap Door names the hidden_field @:affiliate_id@. Obviously this won't work for everyone so you can change the field name by creating an initializer in @config/initializers@ and telling Trap Door the name it should use for the honeypot field:

@TrapDoor.honeypot_field_name = :go_away@

Copyright (c) 2009 Mike Breen, released under the MIT license