diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb index b79be58..ca25343 100644 --- a/app/helpers/tags_helper.rb +++ b/app/helpers/tags_helper.rb @@ -22,6 +22,7 @@ module TagsHelper # # * :max_size: font size for the tag with largest count # * :min_size: font size for the tag with smallest count + # * :show_count: whether to show the count of contents for each tag. Defauls to false. # # The algorithm for generating the different sizes and positions is a # courtesy of Aurelio: http://www.colivre.coop.br/Aurium/Nuvem @@ -47,7 +48,9 @@ module TagsHelper "top: #{ -4 - (v * 4).round }px;" destination = url.kind_of?(Hash) ? url_for(url.merge(tagname_option => tag)) : (url.to_s + tag) - link_to "#{tag}(#{count})", destination, :style => style + display_count = options[:show_count] ? "(#{count})" : "" + + link_to tag + display_count, destination, :style => style end.join("\n") end -- libgit2 0.21.2