On Thu, Jun 18, 2009 at 11:12 AM, Valentino Lun <
[email protected]> wrote:
>
> Dear all
>
> I have problem in print the string in View.
>
> @event = Event.first
>
> puts @event.event_detail
> dreq_reqno dreq_status dreq_create_time
> 09P0917228 0 18 Jun 2009 16:32
> 09P5075748 0 18 Jun 2009 16:32
> 09P5075755 0 18 Jun 2009 16:33
> The format is pretty good using puts
>
> But when I print this in View, the format disorder (Some spaces are
> trimmed.)..
> <td><%= @event.event_detail.event_detail.gsub("\n", "<br>") %></td>
> dreq_reqno dreq_status dreq_create_time
> 09P0917228 0 18 Jun 2009 16:32
> 09P5075748 0 18 Jun 2009 16:32
> 09P5075755 0 18 Jun 2009 16:33
>
> How can I have the "puts @event.event_detail" in View?? I tried this,
> but not work.
> <td><%= puts @event.event_detail %></td>
>
> 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
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---