GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Captcha validation plugin for Rails
Clone URL: git://github.com/wildchild/yacaptcha_validation.git
name age message
file MIT-LICENSE Wed May 14 16:56:32 -0700 2008 first commit [wildchild]
file README Wed May 14 16:56:32 -0700 2008 first commit [wildchild]
file README.rdoc Wed May 14 16:56:32 -0700 2008 first commit [wildchild]
file Rakefile Wed May 14 16:56:32 -0700 2008 first commit [wildchild]
file init.rb Wed May 14 16:56:32 -0700 2008 first commit [wildchild]
file install.rb Wed May 14 16:56:32 -0700 2008 first commit [wildchild]
directory lib/ Thu Jun 26 13:26:54 -0700 2008 Added configuration option to select captcha im... [wildchild]
directory tasks/ Wed May 14 16:56:32 -0700 2008 first commit [wildchild]
directory test/ Wed May 14 16:56:32 -0700 2008 first commit [wildchild]
file uninstall.rb Wed May 14 16:56:32 -0700 2008 first commit [wildchild]
file yacaptcha.example.yml Thu Jun 26 13:26:54 -0700 2008 Added configuration option to select captcha im... [wildchild]
README.rdoc
= YacaptchaValidation

Captcha validation inspired by http://blogs.ericmethot.com/captcha

* Captcha images offline generation using a rake task;
* It's stateless and does not require session data.

== Setup

Install plugin:

  script/plugin install git://github.com/wildchild/yacaptcha_validation.git

Generate captcha images:

  rake yacaptcha:generate

Example script for cron to run rake task:

  #!/bin/sh
  export PATH=$PATH:/home/#####/data/rubygems/bin:/home/#####/data/rubygems/gems/bin
  export RUBYLIB=/home/#####/data/rubygems/local/lib/site_ruby/1.8
  export GEM_HOME=/home/#####/data/rubygems/gems

  cd $HOME/../../containers/rails/[app_name]
  echo "Generating captcha images..."
  rake yacaptcha:generate

== Usage

In model simply add validation check:

  validates_captcha :message => ...

In view:

  <dt>
    <%= yacaptcha_image(comment, :title => 'Captcha image validation') %><br/>
    <label for="comment_captcha_validation">Enter text from image</label>
  </dt>
  <dd>
    <%= f.yacaptcha(:style => 'width: 250px') %>
  </dd>

Copyright (c) 2008 Alexander Uvarov, released under the MIT license.