From ca7eb2e3aa576261967847b6c6b9b335e0293918 Mon Sep 17 00:00:00 2001 From: Craig Davey Date: Thu, 22 Apr 2010 15:32:43 -0400 Subject: [PATCH] =?UTF-8?q?Revised=20yaml=5Fvalue=20helper=20so=20that=20i?= =?UTF-8?q?t=20doesn=E2=80=99t=20apply=20any=20special=20formatting=20to?= =?UTF-8?q?=20blank=20values.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/tolk/application_helper.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/helpers/tolk/application_helper.rb b/app/helpers/tolk/application_helper.rb index ec102bf..f129c0e 100644 --- a/app/helpers/tolk/application_helper.rb +++ b/app/helpers/tolk/application_helper.rb @@ -9,10 +9,12 @@ def format_i18n_text_area_value(value) end def yaml_value(value) - unless value.is_a?(String) - value = value.respond_to?(:ya2yaml) ? value.ya2yaml(:syck_compatible => true) : value.to_yaml + if value.present? + unless value.is_a?(String) + value = value.respond_to?(:ya2yaml) ? value.ya2yaml(:syck_compatible => true) : value.to_yaml + end end - + value end