简体   繁体   English

Ruby on Rails中的ReCaptcha问题

[英]ReCaptcha problems in Ruby on Rails

I have followed the directions posted on ReCaptcha's site about integrating Recaptcha into my application. 我按照ReCaptcha网站上发布关于将Recaptcha集成到我的应用程序中的指示。 However when I go to view it on my localhost I just get the code for get_captcha() instead of the widget. 但是,当我在本地主机上查看它时,我只是获取get_captcha()的代码,而不是小部件。 I have made the public keys available in my environment.rb file, added the recaptcha::apphelper to my application controller, and chained my vaildation, I have also included the recaptcha::viewhelper to my application helper. 我已经在我的environment.rb文件中提供了公钥,将recaptcha :: apphelper添加到我的应用程序控制器,并链接了我的vaildation,我还将recaptcha :: viewhelper包含到我的应用程序帮助程序中。 Am I missing a step in adding it, or is there another resource that would make this work better? 我错过了添加它的步骤,还是有其他资源可以使这项工作更好?

In the view you must use an ERB output block ( <%= ) to make this output the captcha: 在视图中,必须使用ERB输出块( <%= )来使此输出验证码:

<%= raw(get_captcha(:options => {:theme => 'white', :tabindex => 10) %>

Anything not in this (or it's brother, the ERB evaluation block ( <% )) will be treated as plain text. 任何不在此(或它的兄弟,ERB评估块( <% ))的东西都将被视为纯文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM