0
내가 검색 결과에서 열을 평균화하기 위해 노력하고있어 오류 받고 있어요 :BigDecimal를 정의되지 않은 메서드
undefined method `each' for #<BigDecimal:101780440,'0.1776030511 706048E4',27(45)>
보기
<% @vone.each do |v| %>
<%= "%.2f" % (v.lint/227) %>
<% end %>
컨트롤러를
@vone = Result.where(params[:variety_one], params[:years]).includes(:trial).where(params[:region_id], params[:irrigated]).average('lint')
감사 andypp을 제거해야합니다. 보기에서 평균을 불러도 될까요? – Grinskull
네, 그렇게 생각합니다 :) – andypp