neo
neo

Reputation: 4116

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.

Upvotes: 3

Views: 2043

Answers (2)

Matteo G.
Matteo G.

Reputation: 11

This answer probably just need an update.

I currently solved the problem adding this to the Gemfile:

gem "recaptcha", require: "recaptcha/rails"

config.api_version = "v2" seems not to be supported anymore. That's probably because the support for V1 was removed from version 1.0.0 (changelog)

Upvotes: 1

Jiří Pospíšil
Jiří Pospíšil

Reputation: 14401

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

Upvotes: 7

Related Questions