When performing a search of shops and paginating the results (10 per page) on the left hand side of the page I need to show the list of employees (without duplicates) that work in all the shops currently displayed.
In the view I have the following but it doesn't feel like the most efficient and it shows duplicate employees
- @shops.each do |shop|
- shop.employees.each do |employee|
%li = link_to "#{employee.name}", employee_path(employee)