install gem invisible_captcha with devise
Yaroslav Shmarov
Posted on March 3, 2021
You need a captcha tool in your app.
Why? For fewer bot sign-ups!
You don't need Google Recaptcha in your app:
Instead - try an open source Ruby alternative!
Quick guide to add gem invisible_captcha to your devise registrations:
gemfile:
gem 'invisible_captcha'
console:
bundle
rails g devise:controllers users -c=registrations
app/controllers/users/registrations_controller.rb
class Users::RegistrationsController < Devise::RegistrationsController
invisible_captcha only: [:create]
routes.rb:
devise_for :users, controllers: {
registrations: 'users/registrations'
}
app/views/devise/registrations/new.html.erb, inside the form:
<%= invisible_captcha %>
That's it! And no dependency on external API!
💖 💪 🙅 🚩
Yaroslav Shmarov
Posted on March 3, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.