Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise, allowing users to change passwords

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 change their password by entering their old password and entering a new one and I found: https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-edit-their-password but it does not give enough detail.

What do I need to put in my routes?

Where and what do I need to put in my views?

like image 517
Travis Pessetto Avatar asked Aug 03 '11 14:08

Travis Pessetto


2 Answers

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.

like image 67
rookieRailer Avatar answered Nov 07 '22 02:11

rookieRailer


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

like image 22
Travis Pessetto Avatar answered Nov 07 '22 03:11

Travis Pessetto