Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Captcharific

Captcharific

This is an attempt to make a Captcha system that is, at least somewhat, user friendly. It offers a multiple choice question the user answers.

Why? Captcha is a horrible, horrible, solution to preventing bot registrations and spam. Unfortunately, it’s one of the easier, more reliable ways to implement said prevention. Plus, nobody has really come up with an elegant solution anyway. Captcharific isn’t that solution. It’s a stop-gap in usability.

Configuration

You set all of the configuration in a block, rather like Rails’, in your environment.rb. Here’s an example:

Captcharific.configure do |config|
  config.palette = %w(#F38400 #5D8400 #832700 #832761 #390085 #DFD385 #DF7A75 #2D7A91 #6E6D74)
  config.cache_dir = File.join(RAILS_ROOT, 'public', 'images', 'captcharific')
end

That sets the list of colors you’ll use for your choices and the directory where they’ll be cached. For now, just run:

rake captcharific:generate

And it will create the images.

Here’s a listing of all the possible configuration settings and their default values:

cache_dir    = 'public/images'         # The folder to render the images into
controller   = :application_controller # The controller that will serve the captchas
image_format = :png                    # Image format to use, can be :png or :jpg
image_prefix = 'captcha-'              # Image filename prefix
image_size   = 25                      # Image size, the image is always a square
mode         = :cached                 # Not supported yet, in future will allow :adhoc
palette      = []                      # Has to be an Array of color hex values: #RRGGBB
param_key    = 'captcharific'          # The name of the generated radio buttons
session_key  = 'captcharific'          # Session variable name

Suggestions

  • Use Captcharific in conjunction with email activation
  • Put the captcha on the activation page instead of the registration page

Ideas

  • Exclusion Rules; make sure that certain colors aren’t put in the same list of choices to help those with color blindess.
  • Have two images; one for the source and the other to match against. One is slightly hue shifted where it’s hard to perceive the difference visually but computers wouldn’t be able to do a direct comparison on the binary data to see if they match

NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly

Users


See all details


Membership

+ Join this railsplugin

Record Maintainer

'None'