I'd like to take a structure like this where each header has a headers and items array:
header
header
\item
item
item
header
header
item
header
item
item
and make it into a list like this:
header
header
item
item
item
header
header
item
header
item
item
I need to be able to handle nested like 6 deep. Right now, I just do an each loop and check for does it have items or does it have headers? But I really don't want to have 6 levels of this- I would like to do some while loop but just not sure how to do it.
I found lots of sites pointed to a website which is now offline. Lucky archive.org is there to help! [link]
I have implemented so. A helper:
And then in the view:
Just check the attribute you use for your model. In my case it was
name
.So, maybe late, but could help others.