I am trying to set up Recaptcha in my Ruby-on-Rails (Rails 3) application using the Ambethia plugin or gem . After I installed the plugin or gem and installed my public and private keys in config / initializers / recaptcha.rb, I use it as follows:
show where my form is displayed
<%=raw recaptcha_tags %>
where I need to check recaptcha
if verify_recaptcha && @question.save
...
else
flash[:error] = "Incorrect word verification. Are you sure you're human?"
redirect_to :back
end
Regardless of the "verify_recaptcha" returns false, and therefore the publication of the form fails.
source
share