Acts_as_threaded with pagination

Does anyone have the magic sql to get pagination working with
acts_as_threaded?

Return like:
1 - parent
1.1 - response
1.1.1 - response to response
1.2 - response
2 - parent
2.1 - response
etc… up to the first 20 or so.

It seems easy to get from a parent to all children, but to say get the
first
20 parents and children is really hard for me to get my head around. I
can
imagine getting them all back and then looping through in memory but to
get
them all neatly in a sql call I cannot figure out.

Any advice? I have currently just used an ajax call with a little “+” to
get
the children to draw and this works - but to give an option to have them
expanded would be nice also.


Regards,
Ian C.

(the code is available at svn://svn.projectlounge.com/open/light - see
the
discussion forum and posts model)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs