Thanks, Roderick and Pedro. I think I will stick with HTMLEntities for
now :-)
Anil
Roderick van Domburg wrote:> Ben Knight wrote:
>> Are there any built-in methods in either Ruby or Rails to do what this
>> library does (i.e. encode/decode HTML)?
>> http://htmlentities.rubyforge.org/
>>
>> The above library works beautifully but I just expected this sort of
>> functionality to be part of Ruby/Rails since languages such as PHP,
>> Java, etc. have this as part of their core functionality.
>
> For encoding, rails provides h() which is an alias to html_escape(). For
> decoding it''s best to use the HTMLEntities library that you
already
> found. Though you can use the stock CGI::unescape(), that will only
> decode numerical HTML entities but no named ones.
>
> --
> Roderick van Domburg
> http://www.nedforce.nl
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---