From 2aadb7e6e90f96a34aebc9d30ed8a63dccd4fa65 Mon Sep 17 00:00:00 2001
From: Alex Shulgin <ash@commandprompt.com>
Date: Mon, 26 Sep 2011 12:58:11 +0300
Subject: [PATCH] Prevent passing :label option to HTML tag in TabularFormBuilder.

---
 lib/tabular_form_builder.rb |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/tabular_form_builder.rb b/lib/tabular_form_builder.rb
index 8dc5265..cda6d77 100644
--- a/lib/tabular_form_builder.rb
+++ b/lib/tabular_form_builder.rb
@@ -41,7 +41,8 @@ class TabularFormBuilder < ActionView::Helpers::FormBuilder
   # Returns a label tag for the given field
   def label_for_field(field, options = {})
       return '' if options.delete(:no_label)
-      text = options[:label].is_a?(Symbol) ? l(options[:label]) : options[:label]
+      text = options.delete(:label)
+      text = l(text) if text.is_a?(Symbol)
       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, 
-- 
1.7.4.1

