Sha256: 96148ddfac5e55b27f5ded624122e80b9173568be187b0f748f4d12183aa680f
Contents?: true
Size: 631 Bytes
Versions: 2
Compression:
Stored size: 631 Bytes
Contents
# frozen_string_literal: true module ActsAsTextcaptcha module TextcaptchaHelper def textcaptcha_fields(f, &block) if f.object.perform_textcaptcha? && f.object.textcaptcha_key build_textcaptcha_form_elements(f, &block) end end private def build_textcaptcha_form_elements(f, &block) captcha_html = f.hidden_field(:textcaptcha_key) if f.object.textcaptcha_question captcha_html += capture(&block) elsif f.object.textcaptcha_answer captcha_html += f.hidden_field(:textcaptcha_answer) end captcha_html.html_safe end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
acts_as_textcaptcha-4.5.1 | lib/acts_as_textcaptcha/textcaptcha_helper.rb |
acts_as_textcaptcha-4.5.0 | lib/acts_as_textcaptcha/textcaptcha_helper.rb |