Forum: Ruby on Rails Ensuring all HTML tags close in text fields

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.
Luke G. (Guest)
on 2008-11-05 23:38
Does anyone know of a way/method/plugin for ensuring HTML tags all close
and/or close them automatically when the data is pulled or pushed into
the database???
Gregory S. (Guest)
on 2008-11-06 00:38
(Received via mailing list)
On Wed, Nov 05, 2008 at 10:38:05PM +0100, Luke G. wrote:
> Does anyone know of a way/method/plugin for ensuring HTML tags all close
> and/or close them automatically when the data is pulled or pushed into
> the database???

Look into Hpricot. Doing Hpricot(htmltext).to_html will give you
well-formed (i.e. all tags close) HTML.

--Greg
This topic is locked and can not be replied to.