回答編集履歴
1
修正
answer
CHANGED
@@ -7,12 +7,12 @@
|
|
7
7
|
sample
|
8
8
|
```rb
|
9
9
|
def create
|
10
|
-
@post =
|
10
|
+
@post = Post.find(params[:post_id])
|
11
11
|
current_user.likes.create!(post_id: @post.id)
|
12
12
|
end
|
13
13
|
|
14
14
|
def destroy
|
15
|
-
@post =
|
15
|
+
@post = Post.find(params[:post_id])
|
16
16
|
current_user.likes.find_by(post_id: @post.id).destroy!
|
17
17
|
end
|
18
18
|
```
|