What is the best way to implement "change history" in Rails?

I want users to be able to see what has been added / changed in a blog post. I'm using Vestal Versions (a great gem) to track changes, but I don't know how to show this to users so they can see what has changed.

My first impulse is to find a different library for ruby ​​and just show the difference between version N and version N-1. What's a good library for this? Is there a more abstract way to do this?

Also does anyone have any opinion on whether the Vestal versions are better than acts_as_audited

?

+2


source to share


1 answer


Regarding the first question, you should check out HTMLDiff which gives you a diff method that compares the changes and shows them with the correct HTML tags (ins, del), which you can then style with CSS.



I haven't used act_as_audited, but looking at the Github page it seems similar. Maybe someone with a lot of experience in both can bring him some light :)

+1


source







All Articles