Forum: Ruby on Rails html special char conversion

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.
Mikhail S. (Guest)
on 2006-01-25 19:49
(Received via mailing list)
I've stucked to such problem:
  I have html entities in database, after using scaffold I've got these
chars not converted (I have strictly " and & in page source). It is what
I need, but after making ./script/generate scaffold modelname
controllername (recreating controller) I've got all special chars
converted into entities like (&quot and others). How can I fetch data
and display it without this conversion?
Neil D. (Guest)
on 2006-01-27 06:43
(Received via mailing list)
Mikhail S. wrote:
> I've stucked to such problem:
>   I have html entities in database, after using scaffold I've got these
> chars not converted (I have strictly " and & in page source). It is what
> I need, but after making ./script/generate scaffold modelname
> controllername (recreating controller) I've got all special chars
> converted into entities like (&quot and others). How can I fetch data
> and display it without this conversion?
>

Hi Mikhail

the h() function works on these "<>&
<%= h('"&<>') %>  generates "&quote;&amp;&lt;&gt"

Regards Neil
This topic is locked and can not be replied to.