我已经实现了一个基于Ajax的投票system.As,我的观点是:
<%=button_to 'Vote',vote_path(:format=>:js,:id=>c.id),:remote=>true%>
我的控制器是:
def vote
@video=Video.find(params[:id])
@video.increment!(:votes)
respond_to do|format|
format.js
end
end
这个机制可以运行fine.But,我想将recaptcha添加到投票系统中,我在place.However中有了所有必要的配置,我不知道什么应该是reCaptcha的视图和控制器修改。谢谢。
编辑:我在使用Ambesthia recaptcha
编辑2:我想在同一个页面中添加不止一次reCaptcha表单。
发布于 2011-04-05 20:12:47
在表单中的视图中,您需要
<%= recaptcha_tags %>
若要在页面中显示reCaptcha框,请执行以下操作。然后,在处理POST参数的控制器方法中,可以使用verify_recaptcha方法。
https://stackoverflow.com/questions/5499240
复制相似问题