Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The error on "Recaptcha" when updating devise to version 2.1.0

The devise was completely returning a flash alert when "Recaptcha" caught wrong keywords.

But after I updated devise version from 1.4.7 to 2.1.0, it always says, "undefined method `render_with_scope' for #"

Does anyone have the same problem? Is this all because of compatibility of devise 2.1.0 with "Recaptcha"?

like image 941
MKK Avatar asked Jan 18 '23 12:01

MKK


1 Answers

I got the same error

In my registration_controller.rb i change render_with_scope :new to render :new that worked for my application.

class RegistrationsController < Devise::RegistrationsController
## This controller overwrite the create method of the users Registration controller
  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    #dld one 
      render :new
    end
  end
end
like image 68
bulleric Avatar answered Jan 31 '23 11:01

bulleric