Acts_as_threaded with pagination

Does anyone have the magic sql to get pagination working with

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
20 parents and children is really hard for me to get my head around. I
imagine getting them all back and then looping through in memory but to
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
the children to draw and this works - but to give an option to have them
expanded would be nice also.

Ian C.

(the code is available at svn:// - see
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