rails/rails — pull request #5691 by avakhov (2012-04-01 05:13:43+00:00)
Title: Block version of label should wrapped in field_with_errors in case of error

Now `f.label(:method){'content'}` is not wrappend in `div.field_with_errors` if there are saving errors.

It happens because the block version uses `@template_object.label_tag` instead local `label_tag` ( [tags/label.rb#L36](https://github.com/rails/rails/blob/0244c0d8f339385a9b420a0565b17d327bf25b13/actionpack/lib/action_view/helpers/tags/label.rb#L36), [tags/label.rb#L59](https://github.com/rails/rails/blob/0244c0d8f339385a9b420a0565b17d327bf25b13/actionpack/lib/action_view/helpers/tags/label.rb#L59) )

We should use local version because it mixes `Helpers::ActiveModelInstanceTag` ( [tags/base.rb#L5](https://github.com/rails/rails/blob/0244c0d8f339385a9b420a0565b17d327bf25b13/actionpack/lib/action_view/helpers/tags/base.rb#L5), [active_model_helper.rb#L11](https://github.com/rails/rails/blob/0244c0d8f339385a9b420a0565b17d327bf25b13/actionpack/lib/action_view/helpers/active_model_helper.rb#L11) )