X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4e501ab0ba22d9d34d478d32638d53e99ecb9a6c..fca114122bb204b34414a17e278748ec8e87e136:/apps/workbench/app/helpers/application_helper.rb diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb index fe7012aa94..2927be8739 100644 --- a/apps/workbench/app/helpers/application_helper.rb +++ b/apps/workbench/app/helpers/application_helper.rb @@ -55,14 +55,15 @@ module ApplicationHelper link_name = link_uuid if opts[:friendly_name] - begin - friendly_name = resource_class.find(link_uuid).friendly_link_name - if friendly_name and not friendly_name.empty? - link_name = friendly_name + if attrvalue.respond_to? :friendly_link_name + link_name = attrvalue.friendly_link_name + else + begin + link_name = resource_class.find(link_uuid).friendly_link_name + rescue RuntimeError + # If that lookup failed, the link will too. So don't make one. + return attrvalue end - rescue RuntimeError - # If that lookup failed, the link will too. So don't make one. - return attrvalue end end if opts[:with_class_name] @@ -96,10 +97,10 @@ module ApplicationHelper "data-emptytext" => "none", "data-placement" => "bottom", "data-type" => input_type, - "data-resource" => object.class.to_s.underscore, - "data-name" => attr, "data-url" => url_for(action: "update", id: object.uuid, controller: object.class.to_s.pluralize.underscore), - "data-original-title" => "Update #{attr.gsub '_', ' '}", + "data-title" => "Update #{attr.gsub '_', ' '}", + "data-name" => attr, + "data-pk" => "{id: \"#{object.uuid}\", key: \"#{object.class.to_s.underscore}\"}", :class => "editable" }.merge(htmloptions) end