Reputation: 6189
A statement defines
<% @groups_for_unit = @groups.select{ |i| i.typeunit_id == unit.id } %>
to be able to present the array by typeunit_id
However this array within the greater set of data needs to have a minimum value extracted form it.
<%= @groups_for_unit %>
renders the array, but the following gives an undefined method for quantity for Array Error
<%= @groups_for_unit.quantity.map(&:to_i).min %>
What is the proper syntax to achieve the result?
Upvotes: 0
Views: 58