<%- limit ||= nil %>

<% if taggable.tags.any? %>
  <span id="tags" class='tags'>
    <% taggable.tag_list_with_limit(limit).each do |tag| %>
      <%= link_to sanitize(tag.name), send("#{taggable.class.name.underscore.pluralize}_path", search: tag.name) %>
    <% end %>

    <% if taggable.tags_count_out_of_limit(limit) > 0 %>
      <%= link_to "#{taggable.tags_count_out_of_limit(limit)}+",
                  send("#{taggable.class.name.underscore}_path", taggable) %>
    <% end %>
  </span>
<% end %>
