Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/182.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 4 重新规划、设计和轨道4_Ruby On Rails 4_Devise_Recaptcha - Fatal编程技术网

Ruby on rails 4 重新规划、设计和轨道4

Ruby on rails 4 重新规划、设计和轨道4,ruby-on-rails-4,devise,recaptcha,Ruby On Rails 4,Devise,Recaptcha,操作系统:Windows 8.1 Ruby 2.0 轨道4.1 设计3.xx 雷帕查宝石 我将recaptcha添加到registrations/new.html.erb视图中: <%= recaptcha_tags %> 我还补充说 <%= recaptcha_tags %> 查看/designe/passwords/new.html.erb 这很好用。我在尝试测试重置密码链接时遇到问题。应用程序崩溃,并显示以下消息: undefined method `val

操作系统:Windows 8.1 Ruby 2.0 轨道4.1 设计3.xx 雷帕查宝石

我将recaptcha添加到registrations/new.html.erb视图中:

<%= recaptcha_tags %>
我还补充说

<%= recaptcha_tags %>

查看/designe/passwords/new.html.erb

这很好用。我在尝试测试重置密码链接时遇到问题。应用程序崩溃,并显示以下消息:

undefined method `valid_captcha?' for #<Devise::PasswordsController:0x00000005e421b8>

block (2 levels) in <module:PasswordsControllerCaptcha>
devise_security_extension (0.8.0) lib/devise_security_extension/patches/passwords_controller_captcha.rb

module DeviseSecurityExtension::Patches

  module PasswordsControllerCaptcha

    extend ActiveSupport::Concern

    included do

      define_method :create do

        if valid_captcha? params[:captcha]

          self.resource = resource_class.send_reset_password_instructions(params[resource_name])

          if successfully_sent?(resource)

            respond_with({}, :location => new_session_path(resource_name))

          else

            respond_with(resource)
未定义的方法'valid\u captcha'#
中的块(2层)
designe_security_extension(0.8.0)lib/designe_security_extension/patches/passwords_controller_captcha.rb
模块设计安全扩展::补丁
模块密码控制器验证码
扩展ActiveSupport::关注点
包括做
定义方法:创建do
如果验证码有效?参数[:验证码]
self.resource=resource\u class.send\u reset\u password\u指令(参数[resource\u name])
如果成功发送?(资源)
用({},:location=>new_session_path(资源名称))响应_
其他的
回应(资源)

有没有办法解决这个问题?我在哪里处理对验证码验证的响应?我没有访问该控制器的权限。

因为我安装了designe安全扩展,我需要从config/designe.rb中注释掉任何带有config.captcha的内容。一旦我这么做了,一切都很顺利
undefined method `valid_captcha?' for #<Devise::PasswordsController:0x00000005e421b8>

block (2 levels) in <module:PasswordsControllerCaptcha>
devise_security_extension (0.8.0) lib/devise_security_extension/patches/passwords_controller_captcha.rb

module DeviseSecurityExtension::Patches

  module PasswordsControllerCaptcha

    extend ActiveSupport::Concern

    included do

      define_method :create do

        if valid_captcha? params[:captcha]

          self.resource = resource_class.send_reset_password_instructions(params[resource_name])

          if successfully_sent?(resource)

            respond_with({}, :location => new_session_path(resource_name))

          else

            respond_with(resource)