Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit Devise edit user path to fall under the username?

When using the Devise gem, by default the user edit path falls under /signup/edit or /registration/edit. How can we change this to /username/edit? I have already updated the user profile url using FriendlyID to use the username.

like image 339
THpubs Avatar asked Dec 09 '25 05:12

THpubs


1 Answers

Yes, you can change the edit devise paths as follows, Devise provides to override its current path names.

devise_for :users do
   get ':user/edit-profile' => 'devise/registration#edit', :as => :edit_user_profile
end

your link will be like

edit_user_profile_path(current_user)
like image 52
SSR Avatar answered Dec 11 '25 20:12

SSR



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!