I'm trying to figure this problem out. I have a table with a list of items. I'm trying to create a hierarchy between them so I also have a parent_id. For instance
ID Name Parent_id
1 Name1 null
2 Name2 1
3 Name3 1
4 Name4 null
I'm trying to get rails to display this as:
I don't know if this is a rails question or a ruby question, but I can't figure out how to call either the right query or order it in an array correctly.
Any help would be much appreciated.