When I create a comment in my feed, rails is duplicating all the previous comments.
Comments Contoller
def create
@post = Post.find(params[:post_id])
@comment = @post.comments.create(params[:comment])
redirect_to post_path(@post)
end
Posts Show
<div class="content">
<%= markdown(@post.content) %>
<ul class="comments">
<% @post.comments.each do |comment| %>
<%= render @post.comments %>
<% end %>
</ul>
<%= render "comments/form" %>
</div>
_comment.html.erb
<li>
<%= link_to comment.name, comment.url, :title => "visit website", :target => "_blank", :rel => "nofollow" %>
<p><%= comment.body %></p>
<time><%= comment.created_at.utc.strftime("%m.%d.%Y") %></time>
<%= link_to 'X', [comment.post, comment],
:confirm => 'Are you sure?',
:method => :delete %>
</li>
Post.rb
has_many :comments, :dependent => :destroy
Comment.rb
belongs_to :post
After I create first comment

After I create first comment

from your code:
this should either be:
or: