Skip to content

Commit cefabdf

Browse files
Merge pull request rails#45692 from bhaskarshankarling/fixed-the-delete-comment-guide
fixed the delete comment guide and added missing unless statement [ci-skip]
2 parents 752b566 + 8ae17b2 commit cefabdf

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

guides/source/getting_started.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,22 +1944,24 @@ So first, let's add the delete link in the
19441944
`app/views/comments/_comment.html.erb` partial:
19451945

19461946
```html+erb
1947-
<p>
1948-
<strong>Commenter:</strong>
1949-
<%= comment.commenter %>
1950-
</p>
1947+
<% unless comment.archived? %>
1948+
<p>
1949+
<strong>Commenter:</strong>
1950+
<%= comment.commenter %>
1951+
</p>
19511952
1952-
<p>
1953-
<strong>Comment:</strong>
1954-
<%= comment.body %>
1955-
</p>
1953+
<p>
1954+
<strong>Comment:</strong>
1955+
<%= comment.body %>
1956+
</p>
19561957
1957-
<p>
1958-
<%= link_to "Destroy Comment", [comment.article, comment], data: {
1959-
turbo_method: :delete,
1960-
turbo_confirm: "Are you sure?"
1961-
} %>
1962-
</p>
1958+
<p>
1959+
<%= link_to "Destroy Comment", [comment.article, comment], data: {
1960+
turbo_method: :delete,
1961+
turbo_confirm: "Are you sure?"
1962+
} %>
1963+
</p>
1964+
<% end %>
19631965
```
19641966

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

0 commit comments

Comments
 (0)