I have installed the recaptcha gem from https://github.com/ambethia/recaptcha and I have added the
<%= recaptcha_tags >
in my form before submit I have also place public and private key in environment.rb
ENV['RECAPTCHA_PUBLIC_KEY'] = 'xxxxxxxxxxxxxxxx'
ENV['RECAPTCHA_PRIVATE_KEY'] = 'XXXXXXXXXXXXXXxx'
And my controller is like this
def create
if verify_recaptcha
super
else
build_resource
clean_up_passwords(resource)
flash.now[:alert] = "There was an error with the recaptcha code below. Please re-enter the code."
render_with_scope :new
end
end
I also followed the below link https://github.com/plataformatec/devise/wiki/How-To:-Use-Recaptcha-with-Devise since I also use it in my registration controller but every time the verify_recaptcha returns false can anyone plz tell me what I am missing