Here are my devise routes:
devise_for :accounts, :path_names => { :sign_up => "new" } do
get "sign_in", :to => "devise/sessions#new"
get "sign_out", :to => "devise/sessions#destroy"
get "/change_password", :to => "devise/passwords#edit"
end
And the output of my rake routes
:
account_password POST /accounts/password(.:format) {:controller=>"devise/passwords", :action=>"create"}
new_account_password GET /accounts/password/new(.:format) {:controller=>"devise/passwords", :action=>"new"}
edit_account_password GET /accounts/password/edit(.:format) {:controller=>"devise/passwords", :action=>"edit"}
PUT /accounts/password(.:format) {:controller=>"devise/passwords", :action=>"update"}
So the change_password route is not in place and /change_password
just redirects me to the root_path. Please help me understand why or I will hurt myself. Thank you.
Okay, im figured out the problem. Edit password is from Recoverable module, it aims to help the user to get his/her password back if its forgotten, and not for a signed in user to change his/her password. You can use registration/edit instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With