views:

87

answers:

1

If I were to implement a system identical to the StackOverflow question revision history using Ruby on Rails, what would I need to do in order to achieve that? I am creating a site that acts like a wiki where user contributed content can be updated by other people. I need to be able to track the history of these changes, but I am not familiar with how to implement this.

I am aware that a similar question already exists, but I am not satisfied with the accepted answer. It doesn't describe in enough detail how it needs to be implemented from start to finish. So I need to ask it again.

+2  A: 

When an entry is edited, you don't delete the (old) entry, you just add a new entry with a new version number. When you want to retrieve an entry for display, you pick the one with the highest version number. When you want to retrieve an entry to show its revision history, you pick all of them and sort them by version number.

dty