So I searched for any nice solution, but all was quite messy. The solution was really simple.
To limit the tag-cloud, having something like:
<% tag_cloud(Model.tag_counts, %w[s m l]) do |tag, css_class| %>
<%= link_to tag.name, tag_path(tag.name), class: css_class %>
<% end %>
The solution is something like:
<% tag_cloud(Model.tag_counts.limit(30), %w[s m l]) do |tag, css_class| %>
<%= link_to tag.name, tag_path(tag.name), class: css_class %>
<% end %>
But almost all the solutions on the web makes changes in the controller, models and so on, but almost all that solutions adds more things than the simple answer to the problem
No hay comentarios.:
Publicar un comentario