質問するログイン新規登録

回答編集履歴

1

修正

2020/12/09 22:09

投稿

neko_daisuki
neko_daisuki

スコア2090

answer CHANGED
@@ -21,11 +21,11 @@
21
21
 
22
22
  create.js.erb
23
23
  ```
24
- $("#like-button-#{@post.id}").html("<%= j(render partial: 'like', locals: { posts: @posts, likes: @likes, like: @like, post: @post}) %>")
24
+ $("#like-button-<%= @post.id %>").html("<%= j(render partial: 'like', locals: { posts: @posts, likes: @likes, like: @like, post: @post}) %>")
25
25
 
26
26
  ```
27
27
 
28
28
  destroy.js.erb
29
29
  ```
30
- $("#like-button-#{@post.id}").html("<%= j(render partial: 'like', locals: { posts: @posts, likes: @likes, like: @like, post: @post}) %>")
30
+ $("#like-button-<%= @post.id %>").html("<%= j(render partial: 'like', locals: { posts: @posts, likes: @likes, like: @like, post: @post}) %>")
31
31
  ```