ruby-on-rails – 停止设计的当前密码要求

ruby-on-rails – 停止设计的当前密码要求,第1张

概述我的网站编辑用户部分存在问题.出于某种原因,我在尝试编辑用户时不断收到错误“当前密码不能为空”.我们使用devise来管理用户,但我似乎无法在任何地方找到会产生此错误的代码. 以下是表单的代码: - semantic_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => 我的网站编辑用户部分存在问题.出于某种原因,我在尝试编辑用户时不断收到错误“当前密码不能为空”.我们使用devise来管理用户,但我似乎无法在任何地方找到会产生此错误的代码.

以下是表单的代码:

- semantic_form_for(resource,:as => resource_name,:url => registration_path(resource_name),:HTML => { :method => :put }) do |form|    = devise_error_messages!    = form.semantic_errors    = form.input :first    = form.input :last    = form.input :birth_year,as: :select,collection: User.birth_range.to_a.reverse    %i= t('users.edit.cast_biometrics_hint')    = form.input :gender,collection: gender_options,include_blank: false    = form.input :eye_color,collection: eye_color_options,required: false    = form.input :hair_color,collection: hair_color_options,required: false    = form.input :ethnicity,collection: ethnicity_options,required: false    %li.select.optional#user_height_input      %label{for: 'user_height'} Height      %select#user_height_ft{name: 'user[height_ft]'}        = options_for_select 0..9,resource.height_ft      %span ft        %select#user_height_in{name: 'user[height_in]'}        = options_for_select 0..11,resource.height_in      %span in    = form.buttons
解决方法 设计维基中有更多关于此的信息. https://github.com/plataformatec/devise/wiki/How-To%3a-Allow-users-to-edit-their-account-without-providing-a-password 总结

以上是内存溢出为你收集整理的ruby-on-rails – 停止设计的当前密码要求全部内容,希望文章能够帮你解决ruby-on-rails – 停止设计的当前密码要求所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1286702.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存