Add comments'

This commit is contained in:
Ryan W
2021-12-16 14:33:08 -08:00
parent 4edabe6ab1
commit 3a146f7f60
15 changed files with 97 additions and 5 deletions
+10 -2
View File
@@ -5,8 +5,16 @@
</p>
<p>
<strong>Text:</strong>
<%= article.text %>
Posted <%= time_tag article.created_at %>
</p>
<p>
<strong><%= pluralize article.comments.count, "comment" %></strong>
</p>
<p>
<strong>Content:</strong>
<%= article.content %>
</p>
<p>
+7
View File
@@ -0,0 +1,7 @@
<h2>Comments</h2>
<div id="comments">
<%= render article.comments %>
</div>
<%= render "comments/new", article: article %>
+1
View File
@@ -3,6 +3,7 @@
<p id="notice"><%= notice %></p>
<%= render @article %>
<%= render "articles/comments", article: @article %>
<div>
<%= link_to "Edit this article", edit_article_path(@article) %> |