I am looping through an array of id's like so:
<% @tip.horse_ids.each do |i| %>
<% @horse = Horse.find(i) %>
<%= @horse.race.meeting.racecourse.strip %><br />
<%= @horse.race.time.to_s(:time) %> - <%= @horse.name.strip %><br />
<% end %>
Which outputs something like this:
Kempton (AW)
01:30 - Light Gunner
Kempton (AW)
01:30 - Mesophere
Kempton (AW)
01:30 - Ragtag Rascal
Kempton (AW)
01:30 - Many Waters
Kempton (AW)
02:40 - Judicial
Stratford
01:40 - Rabunda
Stratford
I only want "Kempton (AW)" to appear once in the loop (the first one) and same for the time so "1:30" should only appear once too I want to remove all the duplicated content. Any help would be much appreciated, thanks!