mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
[ci skip] Add code example for MailHelper#block_format documentation
This commit is contained in:
parent
daa455f5ca
commit
435aa7e34f
1 changed files with 11 additions and 1 deletions
|
@ -4,7 +4,17 @@ module ActionMailer
|
|||
# attachments list.
|
||||
module MailHelper
|
||||
# Take the text and format it, indented two spaces for each line, and
|
||||
# wrapped at 72 columns.
|
||||
# wrapped at 72 columns:
|
||||
#
|
||||
# text = <<-TEXT
|
||||
# This is
|
||||
# the paragraph.
|
||||
#
|
||||
# * item1 * item2
|
||||
# TEXT
|
||||
#
|
||||
# block_format text
|
||||
# # => " This is the paragraph.\n\n * item1\n * item2\n"
|
||||
def block_format(text)
|
||||
formatted = text.split(/\n\r?\n/).collect { |paragraph|
|
||||
format_paragraph(paragraph)
|
||||
|
|
Loading…
Reference in a new issue