Sha256: e7c1f276fadccf8ef9ea317c47e4ac956e6e0e8a2aeb83be3d0d47d129b21017

Contents?: true

Size: 940 Bytes

Versions: 19

Compression:

Stored size: 940 Bytes

Contents

module SimpleCaptcha #:nodoc
  module ViewHelper #:nodoc
    def show_simple_captcha(options={})
      key = simple_captcha_key(options[:object])
      options[:field_value] = set_simple_captcha_data(key, options)

      defaults = {
          :image            => simple_captcha_image(key, options),
          :label            => options[:label] || I18n.t('simple_captcha.label'),
          :field            => simple_captcha_field(options),
          :error_messages   => options[:error_messages]
      }

      render :partial => 'simple_captcha/simple_captcha', :locals => { :simple_captcha_options => defaults }
    end
  end
end

SimpleCaptcha.setup do |sc|
  sc.image_size = "200x50"
  sc.length = 4
  sc.charset = "1234567890"

  sc.add_image_style("enjoy_cms_style", ["-alpha set", "-fill 'red'", "-background 'transparent'", "-size 200x50", "xc:transparent"])

  sc.image_style = 'enjoy_cms_style'

  sc.tmp_path = "tmp/sc"
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
enjoy_cms-0.3.7.4 config/initializers/simple_captcha.rb
enjoy_cms-0.3.7.3 config/initializers/simple_captcha.rb
enjoy_cms-0.3.7.2 config/initializers/simple_captcha.rb
enjoy_cms-0.3.7.1 config/initializers/simple_captcha.rb
enjoy_cms-0.3.7 config/initializers/simple_captcha.rb
enjoy_cms-0.3.6.2 config/initializers/simple_captcha.rb
enjoy_cms-0.3.6.1 config/initializers/simple_captcha.rb
enjoy_cms-0.3.6 config/initializers/simple_captcha.rb
enjoy_cms-0.3.5 config/initializers/simple_captcha.rb
enjoy_cms-0.3.4 config/initializers/simple_captcha.rb
enjoy_cms-0.3.3 config/initializers/simple_captcha.rb
enjoy_cms-0.3.2.1 config/initializers/simple_captcha.rb
enjoy_cms-0.3.2 config/initializers/simple_captcha.rb
enjoy_cms-0.3.1.2 config/initializers/simple_captcha.rb
enjoy_cms-0.3.1.1 config/initializers/simple_captcha.rb
enjoy_cms-0.3.1 config/initializers/simple_captcha.rb
enjoy_cms-0.3.0.4 config/initializers/simple_captcha.rb
enjoy_cms-0.3.0.3 config/initializers/simple_captcha.rb
enjoy_cms-0.3.0.2 config/initializers/simple_captcha.rb