Re: Display a string properly in View

Valentino Lun
Thu, 18 Jun 2009 09:36:38 -0000

Dear Gavin

Thanks for your reply, it works well after amend the css file.

But I don''t understand how the helper_method can use to generate a
table?? Could you further elaborate on it? (Sorry that I am new in
rails..)

Many thanks
Valentino

Gavin Morrice wrote:
> Hi Valentino
>
> You shouldn''t use puts, for output in the view.
>
> You probably want to split the info for each event into seperate cells
> so your table is well-structured.
> In which case I''d write a helper_method and throw most of the work
> into there.
>
> If not, you can stop html from collapsing white-space by either
> replacing each space with &nbsp; (non-breaking space) or set the
> table''s style:
>
> table {
>   white-space: pre;
> }
>
> in your css.
>
> Gav
>
> http://handyrailstips.com
>
> On Jun 18, 10:12�am, Valentino Lun <rails-mailing-l...@andreas-s.net>