THpubs
THpubs

Reputation: 8172

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.

Upvotes: 3

Views: 2640

Answers (1)

SSR
SSR

Reputation: 6438

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)

Upvotes: 1

Related Questions