You can use simple-captcha v1rtual branch with mongo support. Simple and clean setup and use:
Just add to your gemfile as:
gem 'wolcanus-simple_captcha', :require => 'simple_captcha', :git => 'git://github.com/v1rtual/simple-captcha.git'
Run the generator:
rails generate simple_captcha
For Controller Based, add the following line to the file "app / controllers / application.rb":
ApplicationController < ActionController::Base include SimpleCaptcha::ControllerHelpers end
In the view file in the form tag, add this code:
<%= show_simple_captcha %>
and in the action of the controllers authenticate it as
if simple_captcha_valid? do this else do that end
Refer to the thread for additional options: https://github.com/v1rtual/simple-captcha
source share