I used the standard devise redirection method after the update, but unfortunately it does not work. routes.rb

 devise_for :users root "welcome#index" get "/profile" => "profile#index", as: :profile 

here is my application_controller.rb

 def after_update_path_for(resource) profile_path end 

what could be the problem?

    2 answers 2

    You must inherit your own RegistrationsController from the Divise Devise::RegistrationsController and override the path

     class RegistrationsController < Devise::RegistrationsController protected def after_update_path_for(_resource) profile_path end end 

    Also, correct your devise_for in config / routes.rb as follows

     devise_for :users, :controllers => { registrations: :registrations } 
    • Strange, I did as you said, but nevertheless does not work - holden
    • one
      @holden well, this is not quite everything ... it must also be specified in the routes, in the devise_for call. - D-side
    • @D-side Thanks for the comment, with your permission I will add it to the answer. - cheops
    • I dig in the internet, I found it myself, but thanks to all for the help !!! - holden

    Found it and decided. Of course, it is necessary to specify the correct way in routs in order to contact my routes.rb controller

     devise_for :users, controllers: {registrations: 'registrations'} 

    and everything works great