質問編集履歴

3

ルーティング記載を追加

2022/01/30 05:55

投稿

hypotest15
hypotest15

スコア20

test CHANGED
File without changes
test CHANGED
@@ -33,6 +33,17 @@
33
33
  end
34
34
  end
35
35
 
36
+ ```
37
+
38
+ ルーティング
39
+ ```
40
+ Rails.application.routes.draw do
41
+ root to: 'xxx#index'
42
+ devise_for :users
43
+ resources :users, only: [:show] do
44
+ resources :yyy, only: [:index]
45
+ end
46
+ end
36
47
  ```
37
48
 
38
49
  # 調べたこと、考えたこと

2

該当メソッドのgitを追加

2022/01/30 04:58

投稿

hypotest15
hypotest15

スコア20

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,7 @@
1
1
  # 解決したいこと
2
2
  ユーザー情報更新後、任意のページに遷移するようにしたい。
3
3
  方法として、after_update_path_forメソッドをオーバーライドする。
4
+ [メソッドGithub](https://github.com/heartcombo/devise/blob/main/app/controllers/devise/registrations_controller.rb#:~:text=resource_name%20if%20sign_in_after_change_password%3F-,respond_with%20resource%2C%20location%3A%20after_update_path_for(resource),-else)
4
5
 
5
6
  # 起こっている問題
6
7
  app/controllers/application_controller.rbで、

1

誤記修正

2022/01/30 04:57

投稿

hypotest15
hypotest15

スコア20

test CHANGED
File without changes
test CHANGED
@@ -82,7 +82,7 @@
82
82
  end
83
83
  end
84
84
  ```
85
- 無事に呼び出せましたが、ダブルレンダーのエラーが発生。
85
+ 無事に呼び出せたが、ダブルレンダーのエラーが発生。
86
86
  これは、binding.pryを抜けたあとに、
87
87
  devise側のafter_update_path_forメソッドが、
88
88
  呼び出されている事が原因だと判断。