Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 602 Bytes

README.markdown

File metadata and controls

33 lines (25 loc) · 602 Bytes

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