N
Nate Leavitt
I'm just looking for other possible solutions. Sorry, this is kinda a
noob question.
Currently I loop through the array and check the value of each hash key
to find values. Is that the only and/or best way to find matches?
example:
@invoices = [{:id => 1, :first_name => 'nate'}, {:id => 2, :fist_name =>
'greg'}, {:id => 3, :first_name =>}]
@invoices.each do |invoice|
if invoice[:id] == params[:contact_id]
bla... bla...
end
end
noob question.
Currently I loop through the array and check the value of each hash key
to find values. Is that the only and/or best way to find matches?
example:
@invoices = [{:id => 1, :first_name => 'nate'}, {:id => 2, :fist_name =>
'greg'}, {:id => 3, :first_name =>}]
@invoices.each do |invoice|
if invoice[:id] == params[:contact_id]
bla... bla...
end
end