<% i = 1 if @processdtl.length>0 @processdtl.each do |items| %> <%=i%> <%=items.proc_code%> <%=items.proc_desc%> <%=items.proc_part_desc%> <%=items.proc_seq%> <%=items.proc_time_req%> <%=items.proc_dept%> <%=currency_formatted(items.proc_cost)%> <% i+=1 end else %> No record(s) found. <% end %>