Forum: Ruby on Rails fetch html and strip tags

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.
7a0237a8c808db7572e49984372d5c6b?d=identicon&s=25 (Guest)
on 2007-01-23 21:57
(Received via mailing list)
I've got this statement in a view

<% open(bill.bill_url).read %>

It's grabbing a url from the db and displaying the html code fine.  But
I'd like to just display the contents of one tag.  Is there an easy way
to strip tags, or choose just one?

Or, will I have to use something like hpricot?

91308e9bc88cb069fd1bcf88e910d042?d=identicon&s=25 Nick Snels (nicksnels)
on 2007-01-23 23:31
If you just want to strip HTML tags take a look at the white_list
plugin, If you
need to do more specific things, Hpricot is a good option.

Kind regards,

Nick Snels
Compare Rails hosting
This topic is locked and can not be replied to.