aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorAndrew Kaspick <andrew@redlinesoftware.com>2008-11-19 12:55:27 -0600
committerMichael Koziarski <michael@koziarski.com>2008-12-01 19:27:03 +0100
commitbda55f82c687920807f606a2b024f1882094ef1e (patch)
tree953bce745ee12b86bf471814ff7adf54548da393 /actionpack/lib
parent25f6524b89900378d08de9ec45757813dbb650cf (diff)
downloadrails-bda55f82c687920807f606a2b024f1882094ef1e.tar.gz
rails-bda55f82c687920807f606a2b024f1882094ef1e.tar.bz2
rails-bda55f82c687920807f606a2b024f1882094ef1e.zip
allow options to be passed to email address auto generation
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1418 state:committed]
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb
index 506138a735..1d9e4fe9b8 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionpack/lib/action_view/helpers/text_helper.rb
@@ -370,8 +370,8 @@ module ActionView
options.reverse_merge!(:link => :all, :html => {})
case options[:link].to_sym
- when :all then auto_link_email_addresses(auto_link_urls(text, options[:html], &block), &block)
- when :email_addresses then auto_link_email_addresses(text, &block)
+ when :all then auto_link_email_addresses(auto_link_urls(text, options[:html], &block), options[:html], &block)
+ when :email_addresses then auto_link_email_addresses(text, options[:html], &block)
when :urls then auto_link_urls(text, options[:html], &block)
end
end
@@ -559,7 +559,7 @@ module ActionView
# Turns all email addresses into clickable links. If a block is given,
# each email is yielded and the result is used as the link text.
- def auto_link_email_addresses(text)
+ def auto_link_email_addresses(text, html_options = {})
body = text.dup
text.gsub(/([\w\.!#\$%\-+.]+@[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)+)/) do
text = $1
@@ -568,7 +568,7 @@ module ActionView
text
else
display_text = (block_given?) ? yield(text) : text
- %{<a href="mailto:#{text}">#{display_text}</a>}
+ mail_to text, display_text, html_options
end
end
end