I'm trying to use the latest version of recaptcha, on views, my captcha looks like:
I would like it look like https://developers.google.com/recaptcha , here's a picture:
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.
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
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 )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.