我需要显示来自远程 db.for 的表值,因为我在控制器中执行了以下操作
def show
@dev = Detail.find(:all)
#raise @devices.inspect
end
在show.html.erb
<h1>TrDeviceDetails#show</h1>
<p>Find me in app/views/tr_device_details/show.html.erb</p>
<%= @dev %>
该页面显示了带有值的表格。
[#<Detail UniqueDeviceID: 14448, SlNo: 609">, #<Detail UniqueDeviceID: 14448, SlNo: 610">].
我只需要显示 SlNo
.when 我写<%=Detail.find(:SlNo)%>
得到错误
undefined method `to_i' for :SlNo:Symbol