use one query to get tag names for sites in browse

This commit is contained in:
Kyle Drake 2017-04-03 01:09:47 -07:00
parent 2b69e9cb8a
commit f9c885c23b
2 changed files with 11 additions and 3 deletions

View file

@ -116,10 +116,10 @@
</a>
</div>
<div class="site-tags">
<% if site.tags.count > 0 %>
<% if @site_tags[site.id].length > 0 %>
<i class="fa fa-tag"></i>
<% site.tags.each_with_index do |tag, index| %>
<a class="" href="/browse?tag=<%= Rack::Utils.escape tag.name %>"><%= tag.name %></a><% if index != site.tags.length - 1 %>,<% end %>
<% @site_tags[site.id].each_with_index do |tag, index| %>
<a class="" href="/browse?tag=<%= Rack::Utils.escape tag %>"><%= tag %></a><% if index != @site_tags[site.id].length - 1 %>,<% end %>
<% end %>
<% end %>
</div>