I have been following the STI example in AWDWR and have a question about
presenting the output.
I want to output a list of Person objects that are grouped by their
type.
I have an array of all the Person objects and I would like the output to
be as follows.
Employee x3
Employee 1
Employee 2
Employee 3
Manager x2
Manager 1
Manager 2
... etc
What is the best method for building the output in the view? Should I
use acts_as_list or tree? You’ll notice I also want to have the count
for each type. Is there a built in way to do this or should I hack
something together?
What is the best method for building the output in the view? Should I
use acts_as_list or tree? You’ll notice I also want to have the count
for each type. Is there a built in way to do this or should I hack
something together?
I would just pull each group out separately in the controller:
What is the best method for building the output in the view? Should I
use acts_as_list or tree? You’ll notice I also want to have the count
for each type. Is there a built in way to do this or should I hack
something together?