Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recaptcha Rails use v2 or version 2 of reCAPTCHA

I'm trying to use the latest version of recaptcha, on views, my captcha looks like: current captcha

I would like it look like https://developers.google.com/recaptcha, here's a picture:

enter image description here

in my form I have:

= form_for [refinery, :inquiries, @inquiry], html: { id: "contact-form" } do |f|    
  = recaptcha_tags display: { display: 'red'}

Anyone know how to accomplish this with gem "recaptcha",https://github.com/ambethia/recaptcha

Thank you in advance.

like image 518
neo Avatar asked Dec 01 '25 03:12

neo


1 Answers

The version of recaptcha that supports the v2 API hasn't been released yet so you need to use the version directly from Github.

gem "recaptcha", github: "ambethia/recaptcha"

And then in the initializer (config/initializers/recaptcha.rb)

Recaptcha.configure do |config|
  config.api_version = "v2"
  ...
end
like image 86
Jiří Pospíšil Avatar answered Dec 03 '25 17:12

Jiří Pospíšil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!