Jamal Abdul Nasir
Jamal Abdul Nasir

Reputation: 2667

Correct display of a string

Upvotes: 0

Views: 131

Answers (2)

zed_0xff
zed_0xff

Reputation: 33217

take a look at simple_format method

i.e. <%= simple_format(params[:text]) %> or <%= simple_format(@text) %> in your erb/rhtml view code

Upvotes: 2

Matt Mitchell
Matt Mitchell

Reputation: 41823

If you're including the string within a textarea in the view then that is odd. However, if you are just printing the string to the page, then you will need to replace newline characters with "<br/>" tags.

Upvotes: 0

Related Questions