postとcommentは1:nの関係で、postにひもづくcommentを削除したいときに
link_to 'Delete'の第二引数を[comment.post, comment],にするらしいのですが、これはどういった意味なのでしょうか?
link_to 'Delete'の第二引数は、rails routesで出てくるpathだと思っていたのですが、ここはどうやって決めればいいのだしょうか?
以下はpost.html.erbから<%= render @post.comments %>で送られてきた_comment.html.erbです
<%= link_to 'Delete', [comment.post, comment], method: :delete, class: "button", data: { confirm: 'Are you sure?' } %>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。