You can do this with array intersection:
@array1 = ['a', 'b', 'c', 'd', 'e']
@array2 = ['d', 'e', 'f', 'g', 'h']
@intersection = @array1 & @array2
@intersection should now be [‘d’, ‘e’]. You can then do the following:
<% if [email protected]? %>
<%= @intersection.size %> Matches Found.
<% else %>
No Matches Found.
<% end %>