1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Rename conflicting ActionMailer::MailHelper#simple_format method

This was conflicting with ActionView::Helpers::TextHelper#simple_format
from within email templates.
This commit is contained in:
Mat Brown 2011-03-09 04:40:03 +08:00 committed by José Valim
parent 092538045e
commit fb34f8577c

View file

@ -4,7 +4,7 @@ module ActionMailer
# each line, and wrapped at 72 columns. # each line, and wrapped at 72 columns.
def block_format(text) def block_format(text)
formatted = text.split(/\n\r\n/).collect { |paragraph| formatted = text.split(/\n\r\n/).collect { |paragraph|
simple_format(paragraph) format_paragraph(paragraph)
}.join("\n") }.join("\n")
# Make list points stand on their own line # Make list points stand on their own line
@ -30,7 +30,7 @@ module ActionMailer
end end
private private
def simple_format(text, len = 72, indent = 2) def format_paragraph(text, len = 72, indent = 2)
sentences = [[]] sentences = [[]]
text.split.each do |word| text.split.each do |word|