Sha256: c068603a09cc4ea9f5bffd4da58076e807b00df5c482cc5852d0eaacf247fac8

Contents?: true

Size: 245 Bytes

Versions: 55

Compression:

Stored size: 245 Bytes

Contents

module BlogHelper

  def tag_cloud(tags, classes)
    max = tags.sort_by(&:count).last
    tags.alphabetically.each do |tag|
      index = tag.count.to_f / max.count * (classes.size - 1)
      yield(tag, classes[index.round])
    end
  end

end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
tkh_content-0.10.10 app/helpers/blog_helper.rb
tkh_content-0.10.9 app/helpers/blog_helper.rb
tkh_content-0.10.8 app/helpers/blog_helper.rb
tkh_content-0.10.7 app/helpers/blog_helper.rb
tkh_content-0.10.6 app/helpers/blog_helper.rb
tkh_content-0.10.5.1 app/helpers/blog_helper.rb
tkh_content-0.10.5 app/helpers/blog_helper.rb
tkh_content-0.10.4 app/helpers/blog_helper.rb
tkh_content-0.10.3 app/helpers/blog_helper.rb
tkh_content-0.10.2 app/helpers/blog_helper.rb
tkh_content-0.10.1 app/helpers/blog_helper.rb
tkh_content-0.10 app/helpers/blog_helper.rb
tkh_content-0.9.20 app/helpers/blog_helper.rb
tkh_content-0.9.19 app/helpers/blog_helper.rb
tkh_content-0.9.18 app/helpers/blog_helper.rb
tkh_content-0.9.17 app/helpers/blog_helper.rb
tkh_content-0.9.16 app/helpers/blog_helper.rb
tkh_content-0.9.15 app/helpers/blog_helper.rb
tkh_content-0.9.14 app/helpers/blog_helper.rb
tkh_content-0.9.13 app/helpers/blog_helper.rb