2006/5/19, Vaishal S. firstname.lastname@example.org:
Anyone have any suggestions on how I could do and display a diffed piece of
text in a style similar to Writeboard (strikeouts etc.)
Q1) Are there any ruby gems for diff?
Q2) How would I represent the diffed text in styled HTML?
There was a mail here on 3.10.05 from Joe C., I quote it below:
Just copy the library from here:
Save it under your railsdir/lib as diff.rb
In your environment.rb add
To use the method in the controller do something like this:
@diff_results = HTMLDiff.diff(@object1.text_to_compare,
in your view do something like this:
<%= @diff_results %>
If you want to change the look of the results, add this to your