How to show only uniq tags in view?

43 Views Asked by At

I have the code below. I would like to make that only one tag print to view for every question. But now it prints two and more times. I know why. But I don't know how to fix it. I used uniq for first line. But I gues it is not very beautiful.

<% question.tags.each do |tag| %>
 <div class="question-text micro_hashtag">
    <%= link_to tag.name, tag_path(name: tag.name) %>
 </div>
<% end %>
0

There are 0 best solutions below