Friday 15 March 2013

How do I encode/decode HTML entities in Ruby? -



How do I encode/decode HTML entities in Ruby? -

i trying decode html entities, such '&amp;lt;' becoming '<'.

i have old gem (html_helpers) seems have been abandoned twice.

any recommendations? need utilize in model.

htmlentities can it:

: jmglov@laurana; sudo gem install htmlentities installed htmlentities-4.2.4 : jmglov@laurana; irb irb(main):001:0> require 'htmlentities' => [] irb(main):002:0> htmlentities.new.decode "&iexcl;i&#39;m highly&nbsp;annoyed character references!" => "¡i'm highly annoyed character references!"

html ruby

No comments:

Post a Comment