aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/tags
diff options
context:
space:
mode:
authorAlexey Vakhov <vakhov@gmail.com>2012-04-01 00:52:48 +0400
committerAlexey Vakhov <vakhov@gmail.com>2012-04-01 08:53:55 +0400
commit889bb4b786941fa2e73163e0b0de10175a999526 (patch)
tree83ca7597874eaaa05081be848062a0fc8a3f7e4b /actionpack/lib/action_view/helpers/tags
parent0244c0d8f339385a9b420a0565b17d327bf25b13 (diff)
downloadrails-889bb4b786941fa2e73163e0b0de10175a999526.tar.gz
rails-889bb4b786941fa2e73163e0b0de10175a999526.tar.bz2
rails-889bb4b786941fa2e73163e0b0de10175a999526.zip
Block version of label should wrapped in field_with_errors in case of error
Diffstat (limited to 'actionpack/lib/action_view/helpers/tags')
-rw-r--r--actionpack/lib/action_view/helpers/tags/label.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/label.rb b/actionpack/lib/action_view/helpers/tags/label.rb
index 1c8bf063ea..ee97f8759b 100644
--- a/actionpack/lib/action_view/helpers/tags/label.rb
+++ b/actionpack/lib/action_view/helpers/tags/label.rb
@@ -33,7 +33,8 @@ module ActionView
options["for"] = name_and_id["id"] unless options.key?("for")
if block_given?
- @template_object.label_tag(name_and_id["id"], options, &block)
+ content = @template_object.capture(&block)
+ label_tag(name_and_id["id"], content, options)
else
content = if @content.blank?
@object_name.gsub!(/\[(.*)_attributes\]\[\d\]/, '.\1')