我收到此错误:
TypeError in Properties#show
在 /Users/taylor/Pro/rentroll_analysis/app/views/properties/show.html.erb 的第 67 行,引发了此异常:
can't convert Array into Integer
这是第 67 行附近的提取源代码:
64: <td><%=u.unit_number%></td>
65: <td><%=u.unit_type%></td>
66: <td><%=number_to_currency(u.market_rent - u.current_rent)%></td>
67: <td><%=number_to_currency(u.market_rent - u.current_rent)*(session[:assumptions]= [:spread_x])%></td>
68:
69: </tr>
70: <%end%>
运行时:
def setup_assumptions
if session[:assumptions].nil?
session[:assumptions]=[:min_spread=>400,:spread_x=>10]
end
end
我敢肯定它相对简单,但我无法弄清楚。