質問編集履歴
1
controllerの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -202,6 +202,40 @@
|
|
202
202
|
|
203
203
|
|
204
204
|
|
205
|
+
|
206
|
+
|
207
|
+
posts_controller.rbの該当箇所
|
208
|
+
|
209
|
+
```Ruby
|
210
|
+
|
211
|
+
def update
|
212
|
+
|
213
|
+
@post = Post.find(params[:id])
|
214
|
+
|
215
|
+
if @post.update(comment_params)
|
216
|
+
|
217
|
+
respond_to do |format|
|
218
|
+
|
219
|
+
format.html { redirect_to user_path(@post.user) }
|
220
|
+
|
221
|
+
format.json { render json: @post }
|
222
|
+
|
223
|
+
end
|
224
|
+
|
225
|
+
else
|
226
|
+
|
227
|
+
render :index
|
228
|
+
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|
232
|
+
|
233
|
+
```
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
205
239
|
他にも必要な情報有りましたら載せます。
|
206
240
|
|
207
241
|
|