خرید بک لینک

Vote count: 0

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 %>
<%= @horse.race.time.to_s(:time) %> - <%= @horse.name.strip %>
<% end %>

Which outputs something like this:

Kempton (AW)
01:30 - Light Guer
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!

asked 7 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 22 فروردين 1396 ساعت: 2:10

صفحه بندی