From bda55f82c687920807f606a2b024f1882094ef1e Mon Sep 17 00:00:00 2001 From: Andrew Kaspick Date: Wed, 19 Nov 2008 12:55:27 -0600 Subject: allow options to be passed to email address auto generation Signed-off-by: Michael Koziarski [#1418 state:committed] --- actionpack/lib/action_view/helpers/text_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 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 - %{#{display_text}} + mail_to text, display_text, html_options end end end -- cgit v1.2.3 From dab78e55cfcc111b898a1c2475c0c5c327db30f9 Mon Sep 17 00:00:00 2001 From: Tekin Suleyman Date: Tue, 25 Nov 2008 11:27:32 +0000 Subject: Ensure ActionMailer doesn't blow up when a two argument proc is set for the asset host Signed-off-by: Michael Koziarski [#1394 state:committed] --- actionpack/lib/action_view/helpers/asset_tag_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index 4ec7a383e5..0633d5414e 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -574,7 +574,7 @@ module ActionView private def request - @controller.request + request? && @controller.request end def request? -- cgit v1.2.3