Re: Display a string properly in View

Valentino Lun
Thu, 18 Jun 2009 09:25:08 -0000

Thank you for your reply

It is not work using this
<%= @event.event_detail %>

it seems that the "\n" is not working in HTML, and the multiple space
are trimmed

event.event_detail.inspect
=> "\"dreq_reqno dreq_status     dreq_create_time\\n  09P0917228
0    18 Jun 2009 16:32\\n  09P5075748          0    18 Jun 2009 16:32\\n
09P5075755          0    18 Jun 2009 16:33\\n\""

Many thanks
Valentino

Andrew Timberlake wrote:
> On Thu, Jun 18, 2009 at 11:12 AM, Valentino Lun <
> rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:
>
>> 09P5075748   0            18 Jun 2009 16:32
>>
>> How can I have the "puts @event.event_detail" in View?? I
tried this,
>> but not work.
>> <%= puts @event.event_detail %>
>>
>> Many thanks
>> Valentino
>>
>
> Remove the puts and just use <%= @event.event_detail... %>
> The ''<%='' is like puts
>
> Andrew Timberlake
> http://ramblingsonrails.com
>
> http://MyMvelope.com - The SIMPLE way to manage your savings