From de1108e5d6652d3ed6f38f36318d6f5fcad71840 Mon Sep 17 00:00:00 2001 From: Anton Bangratz Date: Fri, 1 Oct 2010 18:30:34 +0200 Subject: [PATCH 3/3] Human attributes for labels, using the object name --- actionpack/lib/action_view/helpers/form_helper.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 9ca7986..787f8c6 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -884,7 +884,7 @@ module ActionView else content = if text.blank? if object_name =~ /.+\[(.+)_attributes\]/ then - base_name = $1.singularize + base_name = object.class.name.underscore I18n.t("helpers.label.#{base_name}.#{method_name}", :default => "").presence else I18n.t("helpers.label.#{object_name}.#{method_name}", :default => "").presence -- 1.7.1