Quick, simple, fast captcha for Sinatra
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/sinatra init commit Apr 30, 2009
.gitignore
README.markdown
Rakefile
sinatra-captcha.gemspec

README.markdown

Quick, simple, easy captcha for Sinatra apps

Installation

gem install sinatra-captcha

require 'rubygems'
require 'sinatra'
require 'sinatra/captcha'

get '/' do
  erb :captcha
end

post '/' do
  halt(401, "invalid captcha") unless captcha_pass?
  "passed!"
end

__END__

@@ captcha

Catcha Example

<%= captcha_image_tag %>

<%= captcha_answer_tag %>

Thank you to ERR THE BLOG for inspiration: http://errtheblog.com/posts/43-captchator-on-rails