You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include a prepend_before_action for any action you want to secure:
classRegistrationsController < Devise::RegistrationsControllerprepend_before_action:check_captcha,only: [:create]# Change this to be any actions you want to protect.privatedefcheck_captchaunlessverify_recaptchaself.resource=resource_class.newsign_up_paramsrespond_with_navigational(resource){render:new}endendend
If you are adding reCaptcha in registration page then add the below lines in config/routes.rb. The first one is configuration of devise generated controller (rails g devise:controller [scope]), but if you are using your own "registrations_controller.rb" then use it accordingly.
a) For Devise Generated Controller Route Settings (config/routes.rb):