Hello, My controller is supposed to compare values from a particular column in two different DB tables to find matches and non-matches. I keep on getting an "undefined local variable or method 'bes'" error. My controller looks like this:
class CompareController < ApplicationController def index @bes = Bes.find(:all) @prov = Import.find(:all)
@matches = @prov.select { |prov| prov.prov_service_number == bes.bes_phonenumber } end end
Above, BES is a table housing my company's BlackBerry mobile phone information, and PROV is a table housing our provider's records. My view looks like this:
<% for import in @matches %> <tr> <td><%= bes.bes_displayname %></td> <td><%= bes.bes_phonenumber %></td> <td><%= import.prov_service_number %></td> </tr> <% end %>
Can anybody help me with this? I'm still a newbie on the different types of variables and RoR in general.
Thank you very much! - Jeff Miller