I'm creating a category menu on my app. I use the below code in my view to get unique categories to display.
<%= Listing.uniq.pluck(:category).each do |category| %>
<%= link_to category, category_path(category: category) %>
<% end %>
If you look at the demo at mktdemo.herokuapp.com and click on the category dropdown in the navbar, you'll see the categories displayed. However, at the end, I get an array of all categories. Not sure why this is happening.