From 9e4aa232b2d365181fcc7ac4c368ec6bab30ad96 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Sun, 27 Nov 2011 16:54:59 -0200 Subject: [PATCH] Don't crash when the form builder's object is nil --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1d6119d..d89a3b6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -778,7 +778,7 @@ module ApplicationHelper (field_helpers - %w(hidden_field)).each do |selector| src = <<-END_SRC def #{selector}(field, *args, &proc) - text = object.class.human_attribute_name(field.to_s) + text = object.class.respond_to?(:human_attribute_name) && object.class.human_attribute_name(field.to_s) || field.to_s.humanize NoosferoFormBuilder::output_field(text, super) end END_SRC -- libgit2 0.21.2