How to compare 2 string object and display the differences


#1

Hello, what is the best choice to compare 2 string/text in Ruby ? For
example i have 2 model that each of it have a “content” column, the
question is i like to compare the content of the model and display the
differences in a HTML view with yellow highlighting.

R there any plugin that can solve this problem ?
Do I need to use Regex to solve it ? cos i’m a newbie bout regex.
I found an article
http://markmcb.com/2008/11/04/ruby-on-rails-diff-text-to-html-ins-and-del/
that try to solve the problem using “diff” but apparently it needs a
file processing, so r there a way to do it without involving any
files ?

Thanx