Skip to content

Instantly share code, notes, and snippets.

@lorenzosinisi
Created December 22, 2016 13:35
Show Gist options
  • Save lorenzosinisi/e49cf85876913f4ace142e2ebdbbae94 to your computer and use it in GitHub Desktop.
Save lorenzosinisi/e49cf85876913f4ace142e2ebdbbae94 to your computer and use it in GitHub Desktop.
class RegistrationsController < Devise::RegistrationsController
before_action :check_captcha, only: [:create]
private
def check_captcha
binding.pry # it should stop here
unless verify_recaptcha
self.resource = resource_class.new sign_up_params
respond_with_navigational(resource) { render :new }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment