From ceb2ed3a4f6c68a1c95d92271ba77b5e3d8b6a58 Mon Sep 17 00:00:00 2001 From: Radhika Chippada Date: Sun, 14 Dec 2014 08:27:44 -0500 Subject: [PATCH] 4523: cleaner update of render_editable_attribute method to use textarea for descriptions. --- apps/workbench/app/helpers/application_helper.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb index 5e6d574a4c..11c55c3f77 100644 --- a/apps/workbench/app/helpers/application_helper.rb +++ b/apps/workbench/app/helpers/application_helper.rb @@ -160,10 +160,10 @@ module ApplicationHelper end input_type = 'text' - case object.class.attribute_info[attr.to_sym].andand[:type] - when 'text' + attrtype = object.class.attribute_info[attr.to_sym].andand[:type] + if attrtype == 'text' or attr == 'description' input_type = 'textarea' - when 'datetime' + elsif attrtype == 'datetime' input_type = 'date' else input_type = 'text' @@ -188,9 +188,6 @@ module ApplicationHelper @unique_id ||= (Time.now.to_f*1000000).to_i span_id = object.uuid.to_s + '-' + attr.to_s + '-' + (@unique_id += 1).to_s - if attr == 'description' - input_type = 'textarea' - end span_tag = content_tag 'span', rendervalue, { "data-emptytext" => '(none)', "data-placement" => "bottom", -- 2.30.2