Sha256: 856be1e3ceb36dcf2f931944730e3949749e707755d2d78161c36ff0b78193c6
Contents?: true
Size: 688 Bytes
Versions: 12
Compression:
Stored size: 688 Bytes
Contents
module ActsAsTextcaptcha module TextcaptchaHelper # builds html fields for spam question, answer and hidden encrypted spam answers def textcaptcha_fields(f, &block) model = f.object captcha_html = '' if model.perform_textcaptcha? captcha_html += f.hidden_field(:spam_answers) if model.spam_answer captcha_html += f.hidden_field(:spam_answer) elsif model.spam_question captcha_html += capture(&block) end end # Rails 2 compatability if Rails::VERSION::MAJOR < 3 concat captcha_html, &block.binding else captcha_html.html_safe end end end end
Version data entries
12 entries across 12 versions & 1 rubygems