Why will my RoR Ambethia Recaptcha / gem plugin only return false?

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.

+3
source share
2 answers

check out this Rails 3 example:

https://github.com/tilo/mail_form_example_with_recaptcha
+1
source

. - . verify.rb , API, , verify(). , , 3 . (: timeout = > 50), .

+1

Source: https://habr.com/ru/post/1779426/


All Articles