当我尝试从搜索结果中平均一列时出现错误:
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')