Forum: Ruby on Rails Dumb newbie question - text formatting?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Adam B. (Guest)
on 2006-04-15 04:14
I have a MySQL "text" element that I'm trying to display, but it's not
formatting (i.e. it's all one big paragraph). In the AWD depot example
it doesn't look like they do anything special, but they get formatted
text. I've tried it with both:

<%= show.description %> - puts text, and formats according to any HTML
tags I typed in.

and

<%= h(show.description) %> - puts text and HTML tags, no formatting.

What am I missing?

Thanks,

Adam
Daniel H. (Guest)
on 2006-04-15 04:21
(Received via mailing list)
Hi Adam,

Try simple_format, shown here:
http://api.rubyonrails.org/classes/ActionView/Help...
3

This page also has other helpful text helpers

Daniel
Adam B. (Guest)
on 2006-04-15 05:00
Daniel H. wrote:
> Hi Adam,
>
> Try simple_format, shown here:
> http://api.rubyonrails.org/classes/ActionView/Help...
> 3
>
> This page also has other helpful text helpers
>
> Daniel

That's awesome. Thanks.

-Adam
Justin F. (Guest)
on 2006-04-15 15:50
(Received via mailing list)
Adam B. wrote:
> <%= h(show.description) %> - puts text and HTML tags, no formatting.
>
> What am I missing?

In the depot example Dave T. was using HTML tags to format his
descriptions (and that's why he didn't use h() to escape them).

regards

   Justin
This topic is locked and can not be replied to.