I have an array @horses = [] that I fill with some random horses.
@horses = []
How can I check if my @horses array includes a horse that is already incl
@horses
Arrays in Ruby don't have exists? method, but they have an include? method as described in the docs. Something like
exists?
unless @suggested_horses.include?(horse) @suggested_horses << horse end
should work out of box.