Skip to content

Commit

Permalink
Merge pull request #45692 from bhaskarshankarling/fixed-the-delete-co…
Browse files Browse the repository at this point in the history
…mment-guide

fixed the delete comment guide and added missing unless statement [ci-skip]
  • Loading branch information
jonathanhefner committed Jul 29, 2022
2 parents 752b566 + 8ae17b2 commit cefabdf
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions guides/source/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -1944,22 +1944,24 @@ So first, let's add the delete link in the
`app/views/comments/_comment.html.erb` partial:

```html+erb
<p>
<strong>Commenter:</strong>
<%= comment.commenter %>
</p>
<% unless comment.archived? %>
<p>
<strong>Commenter:</strong>
<%= comment.commenter %>
</p>
<p>
<strong>Comment:</strong>
<%= comment.body %>
</p>
<p>
<strong>Comment:</strong>
<%= comment.body %>
</p>
<p>
<%= link_to "Destroy Comment", [comment.article, comment], data: {
turbo_method: :delete,
turbo_confirm: "Are you sure?"
} %>
</p>
<p>
<%= link_to "Destroy Comment", [comment.article, comment], data: {
turbo_method: :delete,
turbo_confirm: "Are you sure?"
} %>
</p>
<% end %>
```

Clicking this new "Destroy Comment" link will fire off a `DELETE
Expand Down

0 comments on commit cefabdf

Please sign in to comment.