From 2753973ffe5f2742a24bf38ee5b9a3aefba42fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=A4fer?= Date: Thu, 18 Aug 2011 12:43:38 +0200 Subject: [PATCH] Make TabularFormBuilder behave with subforms #586 --- lib/tabular_form_builder.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/tabular_form_builder.rb b/lib/tabular_form_builder.rb index 303f9a83..a366b04c 100644 --- a/lib/tabular_form_builder.rb +++ b/lib/tabular_form_builder.rb @@ -40,8 +40,7 @@ class TabularFormBuilder < ActionView::Helpers::FormBuilder text = options[:label].is_a?(Symbol) ? l(options[:label]) : options[:label] text ||= l(("field_" + field.to_s.gsub(/\_id$/, "")).to_sym) text += @template.content_tag("span", " *", :class => "required") if options.delete(:required) - @template.content_tag("label", text, - :class => (@object && @object.errors[field] ? "error" : nil), - :for => (@object_name.to_s + "_" + field.to_s)) + @template.label(@object_name, field.to_s, text, + :class => (@object && @object.errors[field] ? "error" : nil)) end end