新手问题 Device 更新用户报错: Current password can't be blank

newnewnew · 2013年02月22日 · 最后由 newnewnew 回复于 2013年02月22日 · 3477 次阅读

app/views/device/registrations/edit.html.erb:

然后表单提交报错: Current password can't be blank

请教各位怎么解决啊???

另外还要请教下各位 Current password 是啥呢?有啥作用?

自己写个 controller 或 action 把。

Devise 的 Wiki 里面有介绍

devise 正常情况更新资料需要验证当前密码,你的表单里没有密码字段 提交的话需要参考 devise 的 controller 代码自己添一个 controller,并且用 update_without_password 来更新记录

@huacnlee 看 ruby-china 的源码搞明白了😄

需要 登录 后方可回复, 如果你还没有账号请 注册新账号