Ruby on Rails上的验证码的建议

问题描述:

我想在Rails项目中为提交表单实施验证码,但是我不确定该如何处理。我倾向于实现的简单性和使用时的可靠性,因为它太复杂了,因为我的应用程序不需要太高的安全级别。

I'd like to implement a captcha in a Rails project for a form submission, but I'm not sure what to go with. I'm inclining towards simplicity of implemention, and reliability when in use, over it being too sophisticated, as my application doesn't require too high a level of security.

有人有任何建议吗?

将验证码添加到Rails应用程序的最简单方法是使用 Ambethia reCAPTCHA strong>:

The easiest way to add a CAPTCHA to your Rails application is using Ambethia reCAPTCHA:

1。安装:

config.gem "ambethia-recaptcha", :lib => "recaptcha/rails", 
      :source => "http://gems.github.com"

您也可以将其安装为插件,

You can install it as a plugin, too, if you like.

2。获取reCAPTCHA帐户:

您必须创建一个reCAPTCHA密钥。您可以在 reCAPTCHA网站上进行操作。

You have to create a reCAPTCHA key. You can do it on the reCAPTCHA site.

3。用法:

使用 recaptcha_tags 输出必要的HTML代码,然后使用 verify_recaptcha 。

Use recaptcha_tags to output the necessary HTML code and then verify the input with verify_recaptcha.

4。进一步阅读:

  • Ambethia reCAPTCHA
  • reCAPTCHA documentation