質問編集履歴
1
controllerの追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -100,6 +100,23 @@
|
|
100
100
|
})
|
101
101
|
```
|
102
102
|
|
103
|
+
|
104
|
+
posts_controller.rbの該当箇所
|
105
|
+
```Ruby
|
106
|
+
def update
|
107
|
+
@post = Post.find(params[:id])
|
108
|
+
if @post.update(comment_params)
|
109
|
+
respond_to do |format|
|
110
|
+
format.html { redirect_to user_path(@post.user) }
|
111
|
+
format.json { render json: @post }
|
112
|
+
end
|
113
|
+
else
|
114
|
+
render :index
|
115
|
+
end
|
116
|
+
end
|
117
|
+
```
|
118
|
+
|
119
|
+
|
103
120
|
他にも必要な情報有りましたら載せます。
|
104
121
|
|
105
122
|
よろしくお願いします。
|