I'm in progress of making a little folder system with Ruby on Rails.
I've got a "folders" table. Each "folder" has got an id and a folder_id.
The folder_id is supposed to represent the folders' parent folder.
How can I tell Rails?
I would like Rails to automaticly delete all subfolders of a folder when
I delete the folder it self.
I'm in progress of making a little folder system with Ruby on Rails.
I've got a "folders" table. Each "folder" has got an id and a folder_id.
The folder_id is supposed to represent the folders' parent folder.
How can I tell Rails?
I would like Rails to automaticly delete all subfolders of a folder when
I delete the folder it self.
I'm in progress of making a little folder system with Ruby on Rails.
I've got a "folders" table. Each "folder" has got an id and a folder_id.
The folder_id is supposed to represent the folders' parent folder.
How can I tell Rails?
As has been pointed out, acts_as_tree does this sort of thing. More generally you can do something like