Html special char conversion

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?

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;&<&gt”

Regards Neil

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs