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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community 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
http://markmcb.com/2008/11/04/ruby-on-rails-diff-t...
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
This topic is locked and can not be replied to.