Right now I have this in my video show view:
<% @video.topics.each do |topic| %>
<%= topic.name %>
<% end %>
Problem is that if a video has been associated with two of the same topics, it shows the topic twice. How can I fix this so that it only shows the unique topics?
While you should probably have some validations in your model(s) to prevent this from happening, you can call
#uniqon the array of topics: