Finding the element of a Ruby array with the maximum value for a particular attribute January 18, 2023 by Tarik array.max_by do |element| element.field end Or: array.max_by(&:field)