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.
6ec1e89eef5ce09fbfa56be5b6dd17b5?d=identicon&s=25 Adam Bloom (admanb)
on 2006-04-15 02: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
43ec5998360a0cc21b51afef1781e9c0?d=identicon&s=25 Daniel Higginbotham (Guest)
on 2006-04-15 02: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
6ec1e89eef5ce09fbfa56be5b6dd17b5?d=identicon&s=25 Adam Bloom (admanb)
on 2006-04-15 03:00
Daniel Higginbotham 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
Eea7ad39737b0dbf3de38874e0a6c7d8?d=identicon&s=25 Justin Forder (Guest)
on 2006-04-15 13:50
(Received via mailing list)
Adam Bloom wrote:
> <%= h(show.description) %> - puts text and HTML tags, no formatting.
>
> What am I missing?

In the depot example Dave Thomas 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.