加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

更新设计版本2.1.0时“Recaptcha”上的错误

发布时间:2020-12-17 03:46:03 所属栏目:百科 来源:网络整理
导读:当“Recaptcha”发现错误的关键字时,设计完全返回闪光警报. 但在我将设计版本从1.4.7更新到2.1.0后, 它总是说, “undefined方法`render_with_scope’代表#” 有没有人有同样的问题? 这是因为设计2.1.0与“Recaptcha”的兼容性吗? 解决方法 我得到了同样的
当“Recaptcha”发现错误的关键字时,设计完全返回闪光警报.

但在我将设计版本从1.4.7更新到2.1.0后,
它总是说,
“undefined方法`render_with_scope’代表#”

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

解决方法

我得到了同样的错误

在我的registration_controller.rb中,我改变了
render_with_scope:new to 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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读