Rails tree structure

A couple of days ago I had to make a documents/folder structure for an app. The idea was that there’s two types of objects: categories and documents, the user can click through categories and download documents. A category can contain other categories and documents. We only had to show the category the user is currently in, the files and categories that are in that category and some way to navigate one level higher. So there was no need to see children’s children etc.

»