【问题标题】:How to use simple-captcha with devise in rails 4如何在 rails 4 中使用 simple-captcha 和 devise
【发布时间】:2014-08-28 04:01:15
【问题描述】:

如何将 simple-captcha2 与设计集成?我浏览过其他问题但不满意。

【问题讨论】:

    标签: ruby-on-rails-4 devise simplecaptcha


    【解决方案1】:

    我只是添加registrations_controller.rb

    class RegistrationsController < Devise::RegistrationsController
    
      # POST /resource
      def create
        if simple_captcha_valid?
            super
        else
            build_resource(sign_up_params)
            clean_up_passwords(resource)
            flash.now[:alert] = "There was an error with the Captcha code below. Please re-enter the code."
            render :new
        end
      end
    
    end
    

    它达到了我的目的..

    【讨论】:

      猜你喜欢
      • 2016-10-16
      • 1970-01-01
      • 2015-11-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多