Hi,
I’ve been trying to setup a threaded comments system all weekend using
various plugins and I’m now trying to use awesome_nested_set (http://
GitHub - collectiveidea/awesome_nested_set: An awesome replacement for acts_as_nested_set and better_nested_set.) which seems
to be the most up-to-date nested plugin for Rails.
Unfortunately there is very little documentation around for this
plugin and it’s too complex for my brain.
I’ve got my models set up as follows (stripped down):
class Post < ActiveRecord::Base
has_many :comments
end
class Comment < ActiveRecord::Base
acts_as_nested_set
belongs_to :user
end
Now what I want to do is get all the comments for a Post in one
query and I then want to display the Comments as a multi-level
unordered list (possibly using a helper which yields to a block?).
Can anyone help me out?
Thanks