4

当“Recaptcha”发现错误的关键字时,该设计完全返回了一个闪光警报。

但是在我将设计版本从 1.4.7 更新到 2.1.0 之后,它总是说,“undefined method `render_with_scope' for #”

有没有人有同样的问题?这完全是因为设计 2.1.0 与“Recaptcha”的兼容性吗?

4

1 回答 1

9

我得到了同样的错误

在我的 registration_controller.rb 中,我将 render_with_scope :new更改为render :new 这适用于我的应用程序。

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
于 2012-02-23T11:52:29.723 回答