<div class="container">
  <% controller.redirect_to '/members/sign_in' unless member_signed_in?  %>

  <h1>Posts</h1>
  <%= link_to 'New Post', new_post_path %>

  <% @posts.each do |post| %>
       <h1><%= link_to post.title, post %></h1>
       <h6>Post by <%= post.member.firstname %> <%= post.member.lastname %></h6>
       <p><%= post.content %></p>

       <% post.comments.each do |comment|  %>
         <p>Comment By: <%= comment.member.username %></p>
         <p><%= comment.content %></p>

         <% if current_member.id == comment.member.id %>
           <%= link_to "Delete Comment", [comment.post, comment], method: :delete %> |
           <%= link_to "Edit Comment", edit_post_comment_path(comment.post, comment) %>
         <% end %>
       <% end %>

       <%= form_for([post, post.comments.build]) do |f| %>
         <%= f.text_area :content %>
         <%= f.submit %>
       <% end %>

  <% end %>

</div>

<div class="container">
  <% controller.redirect_to '/members/sign_in' unless member_signed_in?  %>

  <h1>Posts</h1>
  <%= link_to 'New Post', new_post_path %>


  <% @posts.each do |post| %>
       <h1><%= link_to post.title, post %></h1>
       <h6>Post by <%= post.member.firstname %> <%= post.member.lastname %></h6>
       <p><%= post.content %></p>
  <% end %>

</div>

Remove comments from index page
Remove comments from index page
