Hello, I am getting a very strange error... I am working on a view that compares a phone number in one model to a phone number in another model and displays the matches and non-matches. However, when I try to do a comparison using != it just pumps out hundreds of repeating lines. My view looks like this:
<table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="50%" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td colspan="2"> <font size="2" face="verdana"><b>Matches</b></font> </td></tr> <% for bes in @bes %> <% if bes.bes_phonenumber.to_s.size == 11 %> <% bes.bes_phonenumber = bes.bes_phonenumber.to_s.slice(1..11) %> <% bes.bes_phonenumber.to_i %> <% end %>
<% for import in @prov %> <% if bes.bes_phonenumber == import.prov_service_number %>
<tr> <td><%= bes.bes_displayname %></td> <td><%= bes.bes_phonenumber %></td> </tr> <% end %>
<% end %> <% end %> </table> </td> <td width="50%" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td colspan="2"><font size="2" face="verdana"><b>Non-Matches</b></font></td></tr> <% for bes in @bes %> <% if bes.bes_phonenumber.to_s.size == 11 %> <% bes.bes_phonenumber = bes.bes_phonenumber.to_s.slice(1..11) %> <% bes.bes_phonenumber.to_i %> <% end %>
<% for import in @prov %> <% if bes.bes_phonenumber == import.prov_service_number returns false %>
<tr> <td><%= bes.bes_displayname %></td> <td><%= bes.bes_phonenumber %></td> </tr> <% end %>
<% end %> <% end %> </table> </td> </tr> </table>
The first one works perfectly (I think) but the second just pumps out about 100 rows of each bes_displayname and bes_phonenumber. Does anybody know what is causing the error? I tried to find a comparison operator in Ruby to say "not equals" but came up short... Is != not part of Ruby?
Thanks, - Jeff Miller