4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/fcrepo_admin/helpers/associations_helper_behavior.rb', line 4
def link_to_association_target(association)
target = @object.send(association.name)
if association.collection?
link_to_unless target.size == 0, "#{association.class_name} (#{target.size})", fcrepo_admin.object_association_path(@object, association.name) do |text|
text
end
else if target
link_to "#{association.class_name} #{target.pid}", fcrepo_admin.object_path(target)
else
"#{association.class_name} (not assigned)"
end
end
end
|