Note that there are some explanatory texts on larger screens.

plurals
  1. PORails directory database structure
    text
    copied!<p>I'm building a "small" personal web app in Ruby on Rails. I've set it up so that I'm using a MySQL database.</p> <p>The idea is that I'm gonna store and navigate many kinds of data (notes, bookmarks, movie and appliction ratings) with this app. I want to index/categorise this data in a pseudo-directory structure. (The directory structure exists only in the database - not in actual directories)</p> <p>E.g. a bookmark could be stored in Root -> Bookmark -> Funny -> Keyboard cat</p> <p>Now I've seen <a href="https://stackoverflow.com/questions/255800/data-structure-used-for-directory-structure">this question</a> but I don't now whether that solution is the best way to do it in a rails app. A solution similar to the one in the question I linked to above was also what I had in mind. But one could also add an extra table having the relations between folders and their content.</p> <p>The question is how do I structure my models and my database? (The "right" way)</p> <p><strong>Update:</strong> (@Dave and other taggers) Yes, I've thought about tags. And at first I was actually going to ask a much larger question but I was unable to do so in a concise way. The deal is that it's also going to be possible to tag items. And in reality the directories ARE tags - you could say I want to have two ways of organising things - 'structured' tags (directories) and 'free' tags (your old regular tags). But that's a whole different story...</p> <p>For now I just wanna see the "right" way of doing the rails model and the database structure for the directory problem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload