Guest User

Untitled

a guest
Jun 25th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. def tag_cloud
  2. @tags = Article.tag_counts # returns all the tags used
  3. end
  4.  
  5. <% tag_cloud Article.tag_counts.sort { |x, y| x.name <=> y.name }, %w(x-small small normal large x-large) do |tag, css_class| %>
  6. <%= link_to tag.name, tag_url( :tag => tag.name ), :class => css_class %>
  7. <% end %>
  8.  
  9. module ApplicationHelper
  10. include TagsHelper
  11. end
  12.  
  13. module ApplicationHelper
  14. include TagsHelper
  15. end
Add Comment
Please, Sign In to add comment