设计无密码更新用户 [英] Devise update user without password
本文介绍了设计无密码更新用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在没有密码的情况下更新用户属性.情况就像,如果密码和密码确认字段不为空,那么我需要设计错误,如果它们为空,则需要更新其他用户属性.我怎么能用设计做到这一点?
I want to update users attributes without password in devise. The case is like, if password and password confirmation fields are not blank then I need devise error and if they are blank then other user attributes need to be updated. How could I do this with devise?
提前致谢!
推荐答案
这是您要找的吗?来自设计维基
Is this what you're look for? From the Devise wiki
它展示了如何为 rails 3 和 rails 4 做这件事
It shows how to do it for rails 3 and rails 4
========================
=======================
John 的解决方案是一个更简单的替代方案
John's solution is a simpler alternative
这篇关于设计无密码更新用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文