# Delete duplicate entries from a 2 dimensional array in ror

**URL:** <https://www.ruby-forum.com/t/delete-duplicate-entries-from-a-2-dimensional-array-in-ror/236488>\
**Category:** Rails\
**Created:** [September 6, 2013, 4:50pm UTC](https://www.ruby-forum.com/t/delete-duplicate-entries-from-a-2-dimensional-array-in-ror/236488 "2013-09-06T16:50:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [September 6, 2013, 4:50pm UTC](https://www.ruby-forum.com/t/delete-duplicate-entries-from-a-2-dimensional-array-in-ror/236488/1 "2013-09-06T16:50:34Z")

</div>

I am trying to loop an array like this…

```
@mem = []
@tran = Transport.find_all_by_month_and_vehicle(date,vehicle)
tran.each do |t|
  @mem << [Student.find_by_id(t.mem_id), t.transport_date,

```

vehicle.no] if t.mem\_type==“Student”  
@mem \<\< [Employee.find\_by\_id(t.mem\_id), t.transport\_date,  
vehicle.no] if t.mem\_type==“Employee”  
end

And in the view page I am looping it and displaying it like this

```
@mem.each do |m|
  <tr>
            <td><%= link_to m[0].first_name} %></td>
            <td > <%= m[0].age %></td>
            <td id="date"> m[1] </td>
            <td id="vehicle"> m[2] </td>
  </tr>
<%end%>

```

But I am getting duplicates entries here…I need to remove duplicate  
entries from this… How do I do it?? Kindly help
