Commit 4d892fd6 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Fixes #2851.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2531 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 0aebb69c
...@@ -41,7 +41,7 @@ class TabularFormBuilder < ActionView::Helpers::FormBuilder ...@@ -41,7 +41,7 @@ class TabularFormBuilder < ActionView::Helpers::FormBuilder
# Returns a label tag for the given field # Returns a label tag for the given field
def label_for_field(field, options = {}) def label_for_field(field, options = {})
return '' if options.delete(:no_label) return '' if options.delete(:no_label)
text = l(options[:label]) if options[:label] text = options[:label].is_a?(Symbol) ? l(options[:label]) : options[:label]
text ||= l(("field_" + field.to_s.gsub(/\_id$/, "")).to_sym) text ||= l(("field_" + field.to_s.gsub(/\_id$/, "")).to_sym)
text << @template.content_tag("span", " *", :class => "required") if options.delete(:required) text << @template.content_tag("span", " *", :class => "required") if options.delete(:required)
@template.content_tag("label", text, @template.content_tag("label", text,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment