Forum: Ruby on Rails How to compare 2 string object and display the differences

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Geekyra (Guest)
on 2009-04-27 15:01
(Received via mailing list)
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
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 ?

This topic is locked and can not be replied to.