aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/helpers/url_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb
index 19e5941971..bfd154abec 100644
--- a/actionview/lib/action_view/helpers/url_helper.rb
+++ b/actionview/lib/action_view/helpers/url_helper.rb
@@ -180,7 +180,11 @@ module ActionView
url = url_for(options)
html_options['href'] ||= url
- content_tag(:a, name || url, html_options, &block)
+ if block_given?
+ content_tag(:a, capture(&block) || url, html_options)
+ else
+ content_tag(:a, name || url, html_options)
+ end
end
# Generates a form containing a single button that submits to the URL created