Module: Blog::PostsHelper
- Defined in:
- app/helpers/blog/posts_helper.rb
Instance Method Summary collapse
Instance Method Details
#tag_cloud(tags, classes) ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/helpers/blog/posts_helper.rb', line 7 def tag_cloud(, classes) max = .sort_by(&:count).last .each do |tag| index = tag.count.to_f / max.count * (classes.size-1) yield(tag, classes[index.round]) end end |
#tag_links(tags) ⇒ Object
3 4 5 |
# File 'app/helpers/blog/posts_helper.rb', line 3 def tag_links() .split(",").map{|tag| link_to tag.strip, list_blog_posts_path(tag:tag.strip) }.join(", ") end |