diff options
author | José Valim <jose.valim@gmail.com> | 2012-04-01 04:45:10 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-04-01 04:45:10 -0700 |
commit | eb154c529991ed77cd13035e6582178156ba9b32 (patch) | |
tree | 8df387d41b9e9f85144bb68b301fbf1faeb3f420 /actionpack/lib/action_view/helpers | |
parent | 9228aa6f50f943193befc3ca7612d5bbda287c86 (diff) | |
parent | 806f4d8af078884db3b68facb4c04560d449b9eb (diff) | |
download | rails-eb154c529991ed77cd13035e6582178156ba9b32.tar.gz rails-eb154c529991ed77cd13035e6582178156ba9b32.tar.bz2 rails-eb154c529991ed77cd13035e6582178156ba9b32.zip |
Merge pull request #5691 from avakhov/form-label-block
Block version of label should wrapped in field_with_errors in case of error
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/tags/label.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/label.rb b/actionpack/lib/action_view/helpers/tags/label.rb index 1c8bf063ea..16135fcd5a 100644 --- a/actionpack/lib/action_view/helpers/tags/label.rb +++ b/actionpack/lib/action_view/helpers/tags/label.rb @@ -33,7 +33,7 @@ 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) else content = if @content.blank? @object_name.gsub!(/\[(.*)_attributes\]\[\d\]/, '.\1') @@ -55,9 +55,9 @@ module ActionView end content ||= @method_name.humanize - - label_tag(name_and_id["id"], content, options) end + + label_tag(name_and_id["id"], content, options) end end end |