vendor/plugins/validates_captcha/lib/add_captcha_to_action_view.rb
# Returns an +image+ tag with the image generated in the
# +challenge+ object.
# 
# The +options+ parameter is passed on to both CaptchaImageChallenge#generate
# and Rails' image_tag method, so you can control how the image
# and tag are generated.
Returns an +image+ tag with the image generated in the
+challenge+ object.

The +options+ parameter is passed on to both CaptchaImageChallenge#generate
and Rails' image_tag method, so you can control how the image
and tag are generated.
Returns an + image + tag with the image generated in the + challenge + object . The + options + parameter is passed on to both CaptchaImageChallenge#generate and Rails ' image_tag method so you can control how the image and tag are generated .
def captcha_image_tag(challenge, options = {})
        challenge.generate(options)
        challenge.write
        [:fontsize, :padding, :color, :background, :fontweight, :rotate, :font].each{|k| options.delete(k) }
        html = image_tag(
          challenge.file_path,
          {
            :size => "#{challenge.image.columns}x#{challenge.image.rows}",
            :alt => 'CAPTCHA image'
          }.merge(options)
        )
        challenge.cleanup
        html
      end
def captcha_image_tag ( challenge , options = { } ) challenge . generate ( options ) challenge . write [ :fontsize , :padding , :color , :background , :fontweight , :rotate , :font ] . each { | k | options . delete ( k ) } html = image_tag ( challenge . file_path , { :size => "#{challenge.image.columns}x#{challenge.image.rows}" , :alt => 'CAPTCHA image' } . merge ( options ) ) challenge . cleanup html end
Returns an +image+ tag with the image generated in the
+challenge+ object.
Returns an + image + tag with the image generated in the + challenge + object .
# now that we're done with the image, clean up the associated memory
challenge
<not_specific>
options
<not_specific>