@@ -41,7 +41,7 class TabularFormBuilder < ActionView::Helpers::FormBuilder | |||||
41 | # Returns a label tag for the given field |
|
41 | # Returns a label tag for the given field | |
42 | def label_for_field(field, options = {}) |
|
42 | def label_for_field(field, options = {}) | |
43 | return '' if options.delete(:no_label) |
|
43 | return '' if options.delete(:no_label) | |
44 |
text = l(options[:label]) |
|
44 | text = options[:label].is_a?(Symbol) ? l(options[:label]) : options[:label] | |
45 | text ||= l(("field_" + field.to_s.gsub(/\_id$/, "")).to_sym) |
|
45 | text ||= l(("field_" + field.to_s.gsub(/\_id$/, "")).to_sym) | |
46 | text << @template.content_tag("span", " *", :class => "required") if options.delete(:required) |
|
46 | text << @template.content_tag("span", " *", :class => "required") if options.delete(:required) | |
47 | @template.content_tag("label", text, |
|
47 | @template.content_tag("label", text, |
General Comments 0
You need to be logged in to leave comments.
Login now