Skip to content

Instantly share code, notes, and snippets.

@flarnie
Created August 17, 2013 13:53
Show Gist options
  • Save flarnie/6256973 to your computer and use it in GitHub Desktop.
Save flarnie/6256973 to your computer and use it in GitHub Desktop.
Recursive Partial Example Part III- the recursive partial
<li><p><%= comment.body %>
</p>
</li>
<h4>Comment ON A COMMENT</h4>
<p class="teeny">so meta</p>
<%= render "new_comment", :link => comment.link, :parent_comment_id => comment.id %>
<% if comments_by_parent[comment.id] != [] %>
<ul>
<% comments_by_parent[comment.id].each do |subcomment| %>
<%= render "comment", :comment => subcomment, :comments_by_parent => comments_by_parent %>
<% end %>
</ul>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment