0
的多个输出我的新轨道,我已经使用的轨道数,让我的工作和非工作资产的数量和存储他们的变量。计数按资产类型分组。当我尝试在我的索引页上打印计数时,它会以原始格式打印计数。我需要以适当的格式打印它。下面是从代码我控制器 -打印存储在轨HTML页面上的变量格式化方式
@instock_working_type=EquipmentAsset.count(:conditions=>"oos=0 and location='In Stock'", :group=>"asset_type")
@instock_non_working_type=EquipmentAsset.count(:conditions=>"oos=1 and location='In Stock'", :group=>"asset_type")
现在我要打印@instock_working_type和@instock_non_working_type为我所用
<td><b>working Devices Type wise</td>
<td><%=h @instock_working_type %></td>
<td><b>Non working Devices Type wise</td>
<td><%=h @instock_non_working_type %></td>
但出来把它我让我的索引页浏览器是一样的东西 -
{"MVT600"=>1} {"MVT380"=>1, "MVT600"=>2}
,我想在适当的格式喜欢 - MVT380 = 1 MVT600 = 2
请帮我这个。
我很抱歉,但你能否详细说明,使用这我上面给出的块? – mrgreen
检查编辑.. – Bijendra
非常感谢你,你救了我,那完美。 :-) – mrgreen