acts_as_commentable_with_threading comment into a child/reply

I'm having trouble adding a child reply into a comment using the acts_as_commentable_with_threading gem. I can add comments but when it comes to setting the child i just cant seem to get it working. https://github.com/elight/acts_as_commentable_with_threading. A little help would be wonderful to implement a reply in a comment.

Posted over 4 years ago by Wesly
Posted over 4 years ago by Alex Yang

Hi Wesly,

Are you having trouble creating a reply or viewing/displaying it? To create a reply, just create the comment as usual but make sure to set the parent_id field to the id of the parent comment. To display comments, I recommend using iteration to display all the threads properly. In other words, loop over and display all root comments (comments without parents) and for each of those, display all child comments and for each of those, display all child comments, etc. Hope that makes sense!

Best,
Alex

2