def show
@product = Product.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @product }
end
end
查看
<% @product.compoFathers.each do |compo| %>
<% compo.productSon.suppliers.each do |sonSuppl| %>
<%= sonSuppl.price %>
<% end %>
<% end %>
我找最小值,平均值和最高價格。
請謝謝。
你真的在做視圖嗎? – apneadiving
錯誤:未定義的局部變量或方法'最小' – fredhouse
更新在該咒語中,PLZ交叉檢查它。如果執行代碼時出錯,請告訴我。 – Rubyist