We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好: 我使用了devise,不想将验证码失败的error放在user里,想将注册时字段错误信息和验证码失败信息分开,所以想调用verify_rucaptcha? nil,如下例子:
class Users::RegistrationsController < Devise::RegistrationsController def create build_resource(sign_up_params) if verify_rucaptcha? resource.save yield resource if block_given? if resource.persisted? if resource.active_for_authentication? set_flash_message! :notice, :signed_up sign_up(resource_name, resource) respond_with resource, location: after_sign_up_path_for(resource) else set_flash_message! :notice, :"signed_up_but_#{resource.inactive_message}" expire_data_after_sign_in! respond_with resource, location: after_inactive_sign_up_path_for(resource) end else clean_up_passwords resource set_minimum_password_length respond_with resource end else #resource.errors.clear flash.now[:alert] = t('rucaptcha.invalid') clean_up_passwords resource respond_with resource end end end
随后看了一下代码,应该是rucaptcha-2.5.0/lib/rucaptcha/controller_helpers.rb里的75行 add_rucaptcha_validation_error方法里resource引用的是全局resource,不是verify_rucaptcha?传进去的resource。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
你好:
我使用了devise,不想将验证码失败的error放在user里,想将注册时字段错误信息和验证码失败信息分开,所以想调用verify_rucaptcha? nil,如下例子:
随后看了一下代码,应该是rucaptcha-2.5.0/lib/rucaptcha/controller_helpers.rb里的75行
add_rucaptcha_validation_error方法里resource引用的是全局resource,不是verify_rucaptcha?传进去的resource。
The text was updated successfully, but these errors were encountered: