Module: RuCaptcha::ViewHelpers

Defined in:
lib/rucaptcha/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#rucaptcha_image_tag(opts = {}) ⇒ Object



14
15
16
17
# File 'lib/rucaptcha/view_helpers.rb', line 14

def rucaptcha_image_tag(opts = {})
  opts[:class] = opts[:class] || 'rucaptcha-image'
  image_tag(ru_captcha.root_url, opts)
end

#rucaptcha_input_tag(opts = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/rucaptcha/view_helpers.rb', line 3

def rucaptcha_input_tag(opts = {})
  opts[:name] = '_rucaptcha'
  opts[:type] = 'text'
  opts[:autocorrect] = 'off'
  opts[:autocapitalize] = 'off'
  opts[:pattern] = '[0-9a-z]*'
  opts[:maxlength] = RuCaptcha.config.len
  opts[:autocomplete] = 'off'
  tag(:input, opts)
end