IqCaptcha

Prerequisites package: ubuntu 10.04, sudo apt-get install libmagickwand-dev ubuntu 11.04, sudo apt-get install libmagick9-dev ubuntu 12.04, sudo apt-get install graphicsmagick-libmagick-dev-compat CentOS, yum install ImageMagick-devel Mac, brew install imagemagick

Pre requisite gem rmagick

Installation:

  1. Place captcha background image named(iq_captcha_background.png) in your project’s public folder

  2. in Gemfile, gem ‘iq_captcha’ and run bundle install

  3. in routes.rb, mount IqCaptcha::Engine, :at => ‘/iq_captcha’

  4. Now browse for testing, for exaample, localhost:3000/iq_captcha, if the captcha comes then it is OK for the test

  5. to use the captcha in your project’s view

<img src=“/iq_captcha?t=<%= Time.now.to_i %>&pointsize=25&color_code=ffffff”> <input type=“text” name=“iq_captcha_result” />

  1. in controller,

if Captcha::valid?(session,params)

# You are human being

else
      # You are not human
end
  1. You are Done

This project rocks and uses MIT-LICENSE.