Sha256: d06bbffed229c3631dfa8b88a2f4b3ac2a3648e8e3dfcdcc29760a088865781e
Contents?: true
Size: 1.04 KB
Versions: 8
Compression:
Stored size: 1.04 KB
Contents
if defined?(SimpleCaptcha) 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 => 'enjoy/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 = "0123456789" sc.add_image_style("enjoy_cms_style", [ "-alpha set", "-fill 'orange'", "-background 'transparent'", "-size 200x50", "xc:transparent" ]) sc.image_style = 'enjoy_cms_style' sc.tmp_path = "tmp/sc" end end
Version data entries
8 entries across 8 versions & 1 rubygems