You are here: Browse Railsplugins 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.
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
NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly