-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME
45 lines (26 loc) · 907 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
MathCaptcha
===========
TODO: Create form helpers
Validates your Model to be saved by a human (or very clever script) by asking
the user to solve a very basic mathematical equation.
It does not use the session to store the secret, but uses AES from EzCrypto.
Requirements
============
* gem ezcrypto
* users who can calculate
Usage
=====
In your Model < ActiveRecord::Base
has_captcha
In your form view:
<%= @model.captcha.task %> = ?
<%= form.text_field :captcha_solution %>
<%= form.hidden_field :captcha_secret %>
If you want to skip the validation (in tests/specs), you can
Model.skip_captcha! # or
@model.skip_captcha!
and turn that off by
Model.dont_skip_captcha! # or
@model.dont_skip_captcha!
Copyright (c) 2007 Pat Nakajima, released under the MIT license
Copyright (c) 2009 Niklas Hofer, released under the MIT license