Module: Depot::FilesHelper
- Defined in:
- app/helpers/depot/files_helper.rb
Instance Method Summary collapse
Instance Method Details
#tag_cloud_files(classes) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/helpers/depot/files_helper.rb', line 4 def tag_cloud_files(classes) = Depot::File.tag_counts(:conditions => ["files.state='public'"]) = Depot::Filefolder.tag_counts(:conditions => ["state='public'"]) = + return if .empty? max_count = .sort_by(&:count).last.count.to_f .each do |tag| index = ((tag.count / max_count) * (classes.size - 1)).round yield tag, classes[index] end end |