質問編集履歴

5

修正

2022/10/26 10:14

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -80,7 +80,5 @@
80
80
  end
81
81
  ```
82
82
 
83
- !質問で試した結果
84
- ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-10-21/8b0baf01-de61-4400-b3c5-f122ae174946.png)
85
83
 
86
84
  下のメッセージが2人のuserがしっかりとまだいるにもかかわらず、退会済のユーザーと表示しています。

4

試した結果を追記

2022/10/21 06:51

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -79,3 +79,8 @@
79
79
 
80
80
  end
81
81
  ```
82
+
83
+ !質問で試した結果
84
+ ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-10-21/8b0baf01-de61-4400-b3c5-f122ae174946.png)
85
+
86
+ 下のメッセージが2人のuserがしっかりとまだいるにもかかわらず、退会済のユーザーと表示しています。

3

コードの更新

2022/10/21 04:11

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -39,15 +39,13 @@
39
39
  ```views/rooms/_room.html.erb
40
40
  <div>
41
41
  <% @rooms.zip(@anotherEntries) do |room,entry| %>
42
+ <% if entry.nil? %>
43
+ <% else %>
42
44
  <div class="dm-list-box">
43
45
  <div class="dm-list-conent">
44
46
  <div class="dm-list-user-name">
45
47
  <h5>相手:</h5>
46
- <% if @anotherEntries.nil? %>
47
- <p>退会済みのユーザー</p>
48
- <% else %>
49
48
  <p><%= link_to entry.user.name, user_path(entry.user), class: "text-decoration-none" %></p><br />
50
- <% end %>
51
49
  </div>
52
50
  <div class="dm-list-plan-name">
53
51
  <h5>掲載名:</h5>
@@ -58,11 +56,12 @@
58
56
  <p><%= link_to 'メッセージ', room, class: "btn btn-outline-danger btn-lg" %></p>
59
57
  </div>
60
58
  </div><br />
59
+ <% end %>
61
60
  <% end %>
62
61
  <div class="d-flex justify-content-center mb-2">
63
62
  <%== pagy_bootstrap_nav(@pagy) %>
64
63
  </div>
65
- </div>
64
+ </div>
66
65
 
67
66
  ```
68
67
 

2

コードの更新

2022/10/20 04:00

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -43,7 +43,11 @@
43
43
  <div class="dm-list-conent">
44
44
  <div class="dm-list-user-name">
45
45
  <h5>相手:</h5>
46
+ <% if @anotherEntries.nil? %>
47
+ <p>退会済みのユーザー</p>
48
+ <% else %>
46
- <p><%= link_to entry.user.name, user_path(entry.user), class: "text-decoration-none" %></p><br />
49
+ <p><%= link_to entry.user.name, user_path(entry.user), class: "text-decoration-none" %></p><br />
50
+ <% end %>
47
51
  </div>
48
52
  <div class="dm-list-plan-name">
49
53
  <h5>掲載名:</h5>
@@ -59,6 +63,7 @@
59
63
  <%== pagy_bootstrap_nav(@pagy) %>
60
64
  </div>
61
65
  </div>
66
+
62
67
  ```
63
68
 
64
69
  ```rooms_controller.rb/indexアクション

1

質問の修正

2022/10/19 16:43

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,7 +1,7 @@
1
1
  ### 概要
2
2
  1.物理削除式の退会機能を作成。
3
3
 
4
- 2.DM機能にあるroomは削除できない。
4
+ 2.DM機能の部屋にあるroomは削除できない。
5
5
 
6
6
  3.そのため相手方のDM一覧ではuserに関するエラーが発生した。
7
7