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:
-
Place captcha background image named(iq_captcha_background.png) in your project’s public folder
-
in Gemfile, gem ‘iq_captcha’ and run bundle install
-
in routes.rb, mount IqCaptcha::Engine, :at => ‘/iq_captcha’
-
Now browse for testing, for exaample, localhost:3000/iq_captcha, if the captcha comes then it is OK for the test
-
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” />
-
in controller,
if Captcha::valid?(session,params)
# You are human being
else
# You are not human
end
-
You are Done
This project rocks and uses MIT-LICENSE.