Implementing commenting system using acts_as_nested_set

Love AJAX
Tue, 24 Jul 2007 10:41:27 -0000

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.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---