gpt4 book ai didi

ruby-on-rails - 为什么我的 RoR Ambethia Recaptcha 插件/gem 可能只返回错误?

转载 作者:行者123 更新时间:2023-12-04 03:36:45 26 4
gpt4 key购买 nike

我正在尝试使用 Ambethia's plugin or gem 在我的 Ruby-on-Rails 应用程序 (Rails 3) 中设置 Recaptcha .在我安装插件或 gem 并在 config/initializers/recaptcha.rb 中设置我的公钥和私钥后,我这样使用它:

显示我的表单显示的 View

<%=raw recaptcha_tags %>

我需要检查验证码的 Controller

if verify_recaptcha && @question.save
...
else
flash[:error] = "Incorrect word verification. Are you sure you're human?"
redirect_to :back
end

无论如何,'verify_recaptcha' 都会返回 false,因此表单发布不会成功。

最佳答案

查看这个 Rails 3 示例:

https://github.com/tilo/mail_form_example_with_recaptcha

关于ruby-on-rails - 为什么我的 RoR Ambethia Recaptcha 插件/gem 可能只返回错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4399916/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com