# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: C:\Users\Jack\work\cws_reg\vendor\rails\actionpack\lib\action_view\helpers # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: form_helper.rb --- form_helper.rb Base (BASE) +++ form_helper.rb Locally Modified (Based On LOCAL) @@ -545,7 +545,12 @@ add_default_name_and_id(name_and_id) options.delete("index") options["for"] ||= name_and_id["id"] - content = (text.blank? ? nil : text.to_s) || method_name.humanize + content = if text.blank? + key = :"active_record.human_attribute_names.#{object.class.name.underscore.to_sym}.#{method_name}" + I18n.translate(key, :default => object.class.human_attribute_name(method_name)) + else + text.to_s + end label_tag(name_and_id["id"], content, options) end