From 33794037556923c5487a88508e9e0df8482a8d47 Mon Sep 17 00:00:00 2001 From: Canan Date: Thu, 28 May 2020 22:16:16 +0300 Subject: [PATCH] Change registration controller to redirect after submitting user edit form --- app/controllers/users/registrations_controller.rb | 6 +++++- config/routes.rb | 4 ---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 7846429..9f3adb9 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -38,7 +38,7 @@ class Users::RegistrationsController < Devise::RegistrationsController # super # end - # protected + protected # If you have extra params to permit, append them to the sanitizer. # def configure_sign_up_params @@ -50,6 +50,10 @@ def configure_account_update_params devise_parameter_sanitizer.permit(:account_update, keys: [:name, :title]) end + def after_update_path_for(resource) + sign_in_after_change_password? ? user_path(resource) : new_session_path(resource_name) + end + # The path used after sign up. # def after_sign_up_path_for(resource) # super(resource) diff --git a/config/routes.rb b/config/routes.rb index fc6a259..57f08c6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,10 +8,6 @@ resources :users, only: [:show, :index] - as :user do - get 'users/edit', :to => 'devise/registrations#edit', :as => :user_root - end - root 'welcome#index' get 'teams', to: 'teams#index'