
simple_format(text, html_options = {}, options = {})
Returns text transformed into HTML using simple formatting rules. Two or more consecutive newlines(nn) are considered as a paragraph and wrapped in
tags. One newline (n) is considered as a linebreak and a
tag is appended. This method does not remove the newlines from the text.
比如說我們在表單欄位中輸入
|
|
代碼是 <%= post.content %>
結果是


代碼是 <%= simple_format(post.content) %>
結果是


很明顯能看出差別




近期评论