# Implementing commenting system using acts\_as\_nested\_set

**URL:** <https://www.ruby-forum.com/t/implementing-commenting-system-using-acts-as-nested-set/110223>\
**Category:** Rails\
**Created:** [July 24, 2007, 12:43pm UTC](https://www.ruby-forum.com/t/implementing-commenting-system-using-acts-as-nested-set/110223 "2007-07-24T12:43:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Love\_AJAX](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/779978/32.png) [@Love\_AJAX](https://www.ruby-forum.com/u/Love_AJAX)\
**Post date:** [July 24, 2007, 12:43pm UTC](https://www.ruby-forum.com/t/implementing-commenting-system-using-acts-as-nested-set/110223/1 "2007-07-24T12:43:55Z")

</div>

Hi,

I have been trying to implemented a commenting system for my Job  
model. I pretty much got my model to work using (better\_)  
acts\_as\_nested\_set. But I am finding it difficult to display the  
comments in views. How would I recurse the comment tree and display  
the comment details for each child. I was thinking of something like  
this:

---------Controller------------  
@comments = job.comments

------------View------------  
for comment in @comments

display comment details here

 \<% --recurse-- unless comment.children.empty? %\> end

Any help?

Thanks much.
