File: formtastic.rb

package info (click to toggle)
ruby-simple-captcha2 0.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 168 kB
  • sloc: ruby: 589; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 378 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if defined? Formtastic
  require 'formtastic/version'
  if Formtastic::VERSION < '2.2'
    raise 'Only Formtastic Version 2.2 or greater is supported by SimpleCaptcha'
  end

  class SimpleCaptchaInput
    include Formtastic::Inputs::Base
    def to_html
      options.update :object => sanitized_object_name
      builder.send(:show_simple_captcha, options)
    end
  end

end