4523: cleaner update of render_editable_attribute method to use textarea for descript...
authorRadhika Chippada <radhika@curoverse.com>
Sun, 14 Dec 2014 13:27:44 +0000 (08:27 -0500)
committerRadhika Chippada <radhika@curoverse.com>
Sun, 14 Dec 2014 13:27:44 +0000 (08:27 -0500)
apps/workbench/app/helpers/application_helper.rb

index 5e6d574a4cf7a52ff823ebe83611ff09efa420f8..11c55c3f77bed497566b124c34d6bb69c6d0ee0a 100644 (file)
@@ -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",