Devise, allowing users to change passwords

后端 未结 3 1838
攒了一身酷
攒了一身酷 2021-01-12 07:04

I have an application that has a custom registration controller, called users_controller, for devise because only Admin is able to create users. I want to allow users to ch

相关标签:
3条回答
  • 2021-01-12 07:29

    I have found the soulution and have fixed this on the Devise wiki

    0 讨论(0)
  • 2021-01-12 07:35

    This is not enough, tough. You'll have to add attr_accessor :current_password to the model, like explained in here.

    0 讨论(0)
  • 2021-01-12 07:40

    If you have a devise model User, you can use this path to route to the change password page.

    edit_user_registration_path
    

    Just use this in your view as:

    <%= link_to 'Change Password', edit_user_registration_path %>
    

    This should do the trick, it works for me.

    0 讨论(0)
提交回复
热议问题