Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise edit_account_password action redirects me to the root

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.

like image 520
snitko Avatar asked May 12 '11 13:05

snitko


1 Answers

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.

like image 93
Mikhail Nikalyukin Avatar answered Oct 22 '22 12:10

Mikhail Nikalyukin