Module: InvisibleCaptcha::ViewHelpers
- Defined in:
- lib/invisible_captcha/view_helpers.rb
Instance Method Summary collapse
-
#invisible_captcha(honeypot = nil, scope = nil, options = {}) ⇒ String
Builds the honeypot html.
- #invisible_captcha_styles ⇒ Object
Instance Method Details
#invisible_captcha(honeypot = nil, scope = nil, options = {}) ⇒ String
Builds the honeypot html
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/invisible_captcha/view_helpers.rb', line 12 def invisible_captcha(honeypot = nil, scope = nil, = {}) @captcha_ocurrences = 0 unless defined?(@captcha_ocurrences) @captcha_ocurrences += 1 if InvisibleCaptcha. || InvisibleCaptcha.spinner_enabled session[:invisible_captcha_timestamp] = Time.zone.now.iso8601 end if InvisibleCaptcha.spinner_enabled && @captcha_ocurrences == 1 session[:invisible_captcha_spinner] = InvisibleCaptcha.encode("#{session[:invisible_captcha_timestamp]}-#{current_request.remote_ip}") end build_invisible_captcha(honeypot, scope, ) end |
#invisible_captcha_styles ⇒ Object
27 28 29 30 31 |
# File 'lib/invisible_captcha/view_helpers.rb', line 27 def invisible_captcha_styles if content_for?(:invisible_captcha_styles) content_for(:invisible_captcha_styles) end end |