link_name = opts[:link_text]
if !link_name
link_name = link_uuid
+
+ if opts[:friendly_name]
+ 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
+ end
if opts[:with_class_name]
- link_name = "#{resource_class.to_s} #{link_name}"
+ link_name = "#{resource_class.to_s}: #{link_name}"
end
end
+ style_opts[:class] = (style_opts[:class] || '') + ' nowrap'
link_to link_name, { controller: resource_class.to_s.underscore.pluralize, action: 'show', id: link_uuid }, style_opts
else
attrvalue
"data-emptytext" => "none",
"data-placement" => "bottom",
"data-type" => input_type,
- "data-resource" => object.class.to_s.underscore,
"data-name" => attr,
+ "data-pk" => object.uuid,
"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 '_', ' '}",
:class => "editable"
}.merge(htmloptions)
end