我需要显示在视图中的结果
但格式不漂亮
我的代码Rails的显示结果,鉴于格式
- @patient.weight.each do |m|
tr
td = m.date
td = m.weight
td = m.weight/(@patient.weight.first.inch * @patient.weight.first.inch).to_f
这一结果在网页
02/09/2014 23.44 6.4930747922437675
我需要证明只在第3栏6.49
需要帮助
我不知道正确地理解你的意思。如果我是对的,你可以做'''td =(@ patient.weight> 0?(m.weight /(@ patient.weight.first.inch * @ patient.weight.first.inch).to_f) “(2):”对于病人没有重量“)'''' – 2014-10-17 12:11:17