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 (" and others). How can I fetch data and display it without this conversion?
Ok, I''ve solved that after doing something that I can''t understand: I''ve removed ''h'' symbol from the beginning of this string: "<%=h cpu.send(column.name) %>" It is still interesting what I''ve done :)
Mikhail Shevchuk wrote:> Ok, I''ve solved that after doing something that I can''t understand: > I''ve removed ''h'' symbol from the beginning of this string: "<%=h > cpu.send(column.name) %>" > It is still interesting what I''ve done :)The h is an alias for html_escape, if that makes things any clearer... -- Alex
On Wed, 25 Jan 2006 18:30:28 +0000 Alex Young <alex@blackkettle.org> wrote:> Mikhail Shevchuk wrote: > > Ok, I''ve solved that after doing something that I can''t understand: > > I''ve removed ''h'' symbol from the beginning of this string: "<%=h > > cpu.send(column.name) %>" > > It is still interesting what I''ve done :) > The h is an alias for html_escape, if that makes things any clearer...Yes, thanks. Where can I read about other aliases?
Mikhail Shevchuk 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 (" and others). How can I fetch data > and display it without this conversion? >Hi Mikhail the h() function works on these "<>& <%= h(''"&<>'') %> generates ""e;&<>" Regards Neil