【发布时间】:2015-12-19 21:32:30
【问题描述】:
我想在用户更改密码后为其更改一个简单属性。
我有一个名为“password_changed”的用户属性,默认值为 false,但希望在他们更改密码后将其更改为 true。这样做是创建自定义设计密码编辑的唯一方法吗?像这样(https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-edit-their-password)。或者我可以在设计注册控制器上扩展更新方法,例如:
def update
current_user.password_changed = true
current_user.save
end
【问题讨论】:
标签: ruby-on-rails ruby devise