No commit activity in last 3 years
No release in over 3 years
wxianfeng_simple_captcha is captcha for rails,modified from simple_captcha .
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

SimpleCaptcha

captcha for Rails

##原理

simple_captcha 的原理是把生成的 key放到session中,key对应的value存到数据库中,到后端进行比对即可

Requirements

  • ImageMagick

Install

Rails < 3.1

gem 'wxianfeng_simple_captcha', '0.1.0', require: 'simple_captcha' 

Rails >=3.1

gem 'wxianfeng_simple_captcha', '0.2.0', require: 'simple_captcha' 

Rails >=4.0

gem 'wxianfeng_simple_captcha', '0.5.0', require: 'simple_captcha'

Setup

rails generate simple_captcha 
rake db:migrate 

Usage

controller:

 include SimpleCaptcha::ControllerHelpers 

view:

 <%= show_simple_captcha %> 

controller valid:

if simple_captcha_valid? 
 "OK!" 
else
 'Fail!'
end

##DEMO

http://d.wxianfeng.com/demos/simple_captcha