Skip to content

Commit

Permalink
Add views for posts show page
Browse files Browse the repository at this point in the history
  • Loading branch information
tsheporamantso committed Dec 13, 2023
1 parent cf762ef commit cab897e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/views/posts/show.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
<h1>Word of the day</h1>
<div class="container">
<div class="post">
<h4>Post <%= @post.title %></h4>
<p class="count">Comments: <%= @post.comments.count %> | Likes: <%= @post.likes.count %></p>
<p><%= @post.text %></p>
</div>

<div class="comments">
<% @post.comments.each do |comment| %>
<div class="comment">
<p><%= comment.author.name %>: <%= comment.text %></p>
</div>
<% end %>
</div>
</div>

0 comments on commit cab897e

Please sign in to comment.