module EasyCaptcha::ViewHelpers

helper class for ActionView

Public Instance Methods

captcha_tag(*args) click to toggle source

generate an image_tag for captcha image

# File lib/easy_captcha/view_helpers.rb, line 7
def captcha_tag(*args)
  options = { alt: 'captcha', width: EasyCaptcha.captcha_image_width, height: EasyCaptcha.captcha_image_height }
  options.merge! args.extract_options!
  image_tag(captcha_path(i: Time.now.to_i), options)
end