diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-03 10:32:30 -0600 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-03 10:32:30 -0600 |
commit | 99f2cb4918786382413bdd29b3cacfd5b9377677 (patch) | |
tree | 9279a5f1b63a03f51b1a04734a4c70bb6b6c3546 /actionpack/lib/action_view/helpers | |
parent | 0b4858cf38f522208381f9bfbbb5c066aceb30d2 (diff) | |
parent | 1e1056f6435254c81f02fd0fba53d9356050cb00 (diff) | |
download | rails-99f2cb4918786382413bdd29b3cacfd5b9377677.tar.gz rails-99f2cb4918786382413bdd29b3cacfd5b9377677.tar.bz2 rails-99f2cb4918786382413bdd29b3cacfd5b9377677.zip |
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/asset_tag_helper.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/text_helper.rb | 8 |
2 files changed, 5 insertions, 5 deletions
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? 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 |