Sha256: 3cb7a89d60feb17fd6f50064db1934df84141c68e6de9f5d328977927d69622e

Contents?: true

Size: 1.64 KB

Versions: 3

Compression:

Stored size: 1.64 KB

Contents

== EasyCaptcha
A simple captcha implementation for rails 3 based on rmagick

== Installation
To install easy_captcha
  gem install easy_captcha

Add following line to routes.rb
  match "captcha" => EasyCaptcha::Controller

== Configuration
You can write this in "config/initializers/easy_captcha.rb", if you want to customize the default configuration

  EasyCaptcha.setup do |config|
    # Chars
    # config.chars = %w(2 3 4 5 6 7 9 A C D E F G H J K L M N P Q R S T U X Y Z)
    # Length
    # config.length = 6
    # Font
    # config.font_size = 24
    # config.font_fill_color = '#333333'
    # config.font_stroke_color = '#000000'
    # config.font_stroke = 0
    # config.font_family = File.expand_path('../../resources/afont.ttf', __FILE__)
    
    # Image
    #config.image_height = 40
    #config.image_width = 140
    #config.image_background_color = "#FFFFFF"
    
    # Wave
    # config.wave = true
    # config.wave_length = (60..100)
    # config.wave_amplitude = (3..5)
    
    # Sketch
    # config.sketch = true
    # config.sketch_radius = 3
    # config.sketch_sigma = 1
    
    # Implode
    # config.implode = 0.1
    
    # Gaussian Blur
    # config.blur = true
    # config.blur_radius = 1
    # config.blur_sigma = 2
  end

== Example

  <% form_tag '/' do %>
    <% if request.post? %>
      <p><%= valid_captcha?(params[:captcha]) ? 'valid' : 'invalid' %> captcha</p>
    <% end %>
    <p><%= captcha_tag %></p>
    <p><%= text_field_tag :captcha %></p>
    <p><%= submit_tag 'Validate' %></p>
  <% end %>  

== Maintainers

* Marco Scholl (http://github.com/traxanos)

== License

Copyright (c) 2010 Marco Scholl, released under the MIT license

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
easy_captcha-0.1.4 README.rdoc
easy_captcha-0.1.3 README.rdoc
easy_captcha-0.1.2 README.rdoc