Module: EasyCaptcha::ViewHelpers

Defined in:
lib/easy_captcha/view_helpers.rb

Overview

helper class for ActionView

Instance Method Summary collapse

Instance Method Details

#captcha_tag(*args) ⇒ Object

generate an image_tag for captcha image



7
8
9
10
11
# 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