Module: InvisibleCaptcha::ViewHelpers

Defined in:
lib/invisible_captcha/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#invisible_captcha(honeypot = nil, scope = nil, options = {}) ⇒ String

Builds the honeypot html

Parameters:

  • honeypot (Symbol) (defaults to: nil)

    name of honeypot, ie: subtitle => input name: subtitle

  • scope (Symbol) (defaults to: nil)

    name of honeypot scope, ie: topic => input name: topic

  • options (Hash) (defaults to: {})

    html_options for input and invisible_captcha options

Returns:

  • (String)

    the generated html



10
11
12
13
14
15
# File 'lib/invisible_captcha/view_helpers.rb', line 10

def invisible_captcha(honeypot = nil, scope = nil, options = {})
  if InvisibleCaptcha.timestamp_enabled
    session[:invisible_captcha_timestamp] = Time.zone.now.iso8601
  end
  build_invisible_captcha(honeypot, scope, options)
end

#invisible_captcha_stylesObject



17
18
19
20
21
# File 'lib/invisible_captcha/view_helpers.rb', line 17

def invisible_captcha_styles
  if content_for?(:invisible_captcha_styles)
    content_for(:invisible_captcha_styles)
  end
end