From 1b41178a836ae84cf62a11ebd6bd640fd0d09566 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 15 Mar 2008 20:08:51 +0000 Subject: Docfix (closes #11230) [Henrik N] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9035 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/text_helper.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index 599cd43721..3d479608f3 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -292,18 +292,15 @@ module ActionView # method does not remove the newlines from the +text+. # # ==== Examples - # my_text = """Here is some basic text... - # ...with a line break.""" + # my_text = "Here is some basic text...\n...with a line break." # # simple_format(my_text) - # # => "

Here is some basic text...
...with a line break.

" + # # => "

Here is some basic text...\n
...with a line break.

" # - # more_text = """We want to put a paragraph... - # - # ...right there.""" + # more_text = "We want to put a paragraph...\n\n...right there." # # simple_format(more_text) - # # => "

We want to put a paragraph...

...right there.

" + # # => "

We want to put a paragraph...

\n\n

...right there.

" def simple_format(text) content_tag 'p', text.to_s. gsub(/\r\n?/, "\n"). # \r\n and \r -> \n -- cgit v1.2.3