github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

hardbap / trap_door

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 35
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • 348d36782ec2c4d7f3da5f64ddc78d93803e79a0
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Reverse Captcha for your Rails app — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Some spammers are hip to the hidden field trick. 
hardbap (author)
Mon Feb 01 14:03:37 -0800 2010
commit  ec0bcbfcd4581fdfa090a2719f9d5ec3b7c01c5b
tree    2592b9946afab7ebf1cadf14797e7f7702c3fd3c
parent  3332e46303deffe1caea225863311ba0be2479b1
trap_door /
name age
history
message
file MIT-LICENSE Mon Nov 23 13:47:16 -0800 2009 Update license. [hardbap]
file README.textile Mon Nov 23 13:48:30 -0800 2009 Update README so the controller example follows... [hardbap]
file Rakefile Thu Oct 29 11:31:09 -0700 2009 Initial commit. [hardbap]
file init.rb Thu Oct 29 11:31:09 -0700 2009 Initial commit. [hardbap]
file install.rb Thu Oct 29 11:31:09 -0700 2009 Initial commit. [hardbap]
directory lib/ Mon Feb 01 14:05:01 -0800 2010 Some spammers are hip to the hidden field trick... [hardbap]
directory tasks/ Thu Oct 29 11:31:09 -0700 2009 Initial commit. [hardbap]
directory test/ Mon Feb 01 14:05:01 -0800 2010 Some spammers are hip to the hidden field trick... [hardbap]
file uninstall.rb Thu Oct 29 11:31:09 -0700 2009 Initial commit. [hardbap]
README.textile

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.

Installation

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

Using Trap Door

In your view


    <% form_for(@post) do |form| %>
        <%= trap_door_field %>
        
        # the rest of your form...

In your controller


    class PostController < ApplicationController
        trap_door :only => :create
        
        # the rest of your controller...

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 © 2009 Mike Breen, released under the MIT license

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server