Sha256: c6aec58cc07eda91373a94d1cd39a7873af622e64d1f00be7cfab6bd7ea0e78a

Contents?: true

Size: 596 Bytes

Versions: 6

Compression:

Stored size: 596 Bytes

Contents

module ActsAsTextcaptcha
  module TextcaptchaHelper

    # builds html form fields for the textcaptcha
    def textcaptcha_fields(f, &block)
      model        = f.object
      captcha_html = ''
      if model.perform_textcaptcha?
        if model.textcaptcha_key
          captcha_html += f.hidden_field(:textcaptcha_key)
          if model.textcaptcha_question
            captcha_html += capture(&block)
          elsif model.textcaptcha_answer
            captcha_html += f.hidden_field(:textcaptcha_answer)
          end
        end
      end

      captcha_html.html_safe
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
acts_as_textcaptcha-4.3.0 lib/acts_as_textcaptcha/textcaptcha_helper.rb
acts_as_textcaptcha-4.2.0 lib/acts_as_textcaptcha/textcaptcha_helper.rb
acts_as_textcaptcha-4.1.3 lib/acts_as_textcaptcha/textcaptcha_helper.rb
acts_as_textcaptcha-4.1.2 lib/acts_as_textcaptcha/textcaptcha_helper.rb
acts_as_textcaptcha-4.1.1 lib/acts_as_textcaptcha/textcaptcha_helper.rb
acts_as_textcaptcha-4.1.0 lib/acts_as_textcaptcha/textcaptcha_helper.rb