Method: Cms::PathHelper#link_to_usages

Defined in:
app/helpers/cms/path_helper.rb


73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'app/helpers/cms/path_helper.rb', line 73

def link_to_usages(block)
  count = block.connected_pages.count
  if count > 0
    # Would love a cleaner solution to this problem, see http://stackoverflow.com/questions/702728
    path = if Portlet === block
             usages_portlet_path(block)
           else
             p = []
             p << engine_for(block)
             p << :usages
             p.concat path_elements_for(block)
             p
           end
    link_to count, path, :id => block.id, :block_type => block.content_block_type
  else
    count
  end
end