質問編集履歴
7
詳細の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -33,6 +33,18 @@
|
|
33
33
|
```
|
34
34
|
|
35
35
|
```ここに言語を入力
|
36
|
+
/app/controllers/circle_users_controller.rb
|
37
|
+
|
38
|
+
def destroy
|
39
|
+
CircleUser.find(params[:id])
|
40
|
+
@circle_user.destroy
|
41
|
+
@circle = Circle.find(params[:circle_id])
|
42
|
+
redirect_to circle_url(@circle, @circle_user)
|
43
|
+
flash[:info] = "サークル「#{@circle.name}」を退会しました。"
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
```ここに言語を入力
|
36
48
|
/app/controllers/circles_controller.rb
|
37
49
|
def show
|
38
50
|
@circle = Circle.find(params[:id])
|
6
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -39,4 +39,9 @@
|
|
39
39
|
@circleposts = @circle.circleposts.paginate(page: params[:page])
|
40
40
|
@circleposts = Circlepost.where(circle_id: @circle.id).all
|
41
41
|
end
|
42
|
+
```
|
43
|
+
|
44
|
+
### 実施してみたこと
|
45
|
+
```ここに言語を入力
|
46
|
+
ルーティングをネストしているので、引数は二つであり、pathも単数形にしてみましたが、治りませんでした。
|
42
47
|
```
|
5
補足
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[参考記事](https://qiita.com/tttaamm12/items/fbc2a3723ce3077adcbc#%E5%AE%9F%E6%96%BD%E3%81%97%E3%81%9F%E3%81%84%E3%81%93%E3%81%A8)を参考にグループの退会機能を作っていたのですが、エラーが出てしまい、グループから退会することができません。
|
1
|
+
[参考記事](https://qiita.com/tttaamm12/items/fbc2a3723ce3077adcbc#%E5%AE%9F%E6%96%BD%E3%81%97%E3%81%9F%E3%81%84%E3%81%93%E3%81%A8)を参考にグループの退会機能を作っていたのですが、エラーが出てしまい、グループから退会することができません。エラーの内容はわかっているのですが引数にそれらしきものを入れても変わりません。
|
2
2
|
初学者なのでわかりやすく教えていただきたいです。
|
3
3
|
|
4
4
|
|
@@ -13,11 +13,9 @@
|
|
13
13
|
|
14
14
|
・・・
|
15
15
|
```
|
16
|
-
↓url?にcircle_user_idが含まれていないのが原因でしょうか。
|
17
|
-
```
|
18
|
-
circle_circle_user DELETE /circles/:circle_id/circle_users/:id(.:format) circle_users#destro
|
19
|
-
```
|
20
16
|
|
17
|
+
|
18
|
+
|
21
19
|
```ここに言語を入力
|
22
20
|
/app/views/circles/show.html.erb
|
23
21
|
|
4
訂正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
ActionController::UrlGenerationError
|
1
|
+
ActionController::UrlGenerationErrorの解決方法がわかりません
|
body
CHANGED
File without changes
|
3
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -17,7 +17,6 @@
|
|
17
17
|
```
|
18
18
|
circle_circle_user DELETE /circles/:circle_id/circle_users/:id(.:format) circle_users#destro
|
19
19
|
```
|
20
|
-
ここに言語を入力
|
21
20
|
|
22
21
|
```ここに言語を入力
|
23
22
|
/app/views/circles/show.html.erb
|
2
補足
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,10 +2,7 @@
|
|
2
2
|
初学者なのでわかりやすく教えていただきたいです。
|
3
3
|
|
4
4
|
|
5
|
-
↓url?にcircle_user_idが含まれていないのが原因でしょうか。
|
6
5
|
|
7
|
-
circle_circle_user DELETE /circles/:circle_id/circle_users/:id(.:format) circle_users#destroy
|
8
|
-
|
9
6
|
### エラーの内容
|
10
7
|
```
|
11
8
|
ActionController::UrlGenerationError in Circles#show
|
@@ -15,8 +12,13 @@
|
|
15
12
|
<%= link_to '退会する', circle_circle_user_path(@circle, @circle_user), method: :delete, data:{ confirm: "サークル「#{@circle.name}」を退会します。よろしいですか?" } ,class:"btn btn-warning btn-lg" %>
|
16
13
|
|
17
14
|
・・・
|
15
|
+
```
|
16
|
+
↓url?にcircle_user_idが含まれていないのが原因でしょうか。
|
17
|
+
```
|
18
|
+
circle_circle_user DELETE /circles/:circle_id/circle_users/:id(.:format) circle_users#destro
|
19
|
+
```
|
20
|
+
ここに言語を入力
|
18
21
|
|
19
|
-
```
|
20
22
|
```ここに言語を入力
|
21
23
|
/app/views/circles/show.html.erb
|
22
24
|
|
@@ -32,6 +34,7 @@
|
|
32
34
|
<% end %>
|
33
35
|
|
34
36
|
```
|
37
|
+
|
35
38
|
```ここに言語を入力
|
36
39
|
/app/controllers/circles_controller.rb
|
37
40
|
def show
|
1
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
[参考記事](https://qiita.com/tttaamm12/items/fbc2a3723ce3077adcbc#%E5%AE%9F%E6%96%BD%E3%81%97%E3%81%9F%E3%81%84%E3%81%93%E3%81%A8)を参考にグループの退会機能を作っていたのですが、エラーが出てしまい、グループから退会することができません。
|
2
|
+
初学者なのでわかりやすく教えていただきたいです。
|
2
3
|
|
4
|
+
|
3
5
|
↓url?にcircle_user_idが含まれていないのが原因でしょうか。
|
4
6
|
|
5
7
|
circle_circle_user DELETE /circles/:circle_id/circle_users/:id(.:format) circle_users#destroy
|