When I was researching the acts_as_commentable gem I came across the spin off of it that has threading. I looked around for some examples of how to set it up, but just found scattered information.
I have set up a working example of the gem, acts_as_commentable_with_threading. You can find the repo on github.
Here is a look at what we are building.