im making a dynamic table in ruby on rails in which im displaying devices in a table and corresponding to each device i want to show its status which is ibtained dynamically by an ajax function (periodically_call_remote) which updates a div.
its working fine but its updating only the first row i.e. its showing result of periodically call remote for every device in the first row only..not in the corresponding row for each device..
how to make div id's as unique (since it need to identify a unique div for each row)
my code goes like :
<html>
<body>
<p><strong>All Devices</strong><hr /></p>
<table width="300" border="1">
<thead>
<tr>
<th width="130" scope="col">Device Name</th>
<th width="100" scope="col">Ping Result</th>
</tr>
</thead>
<tbody>
<% @devices.each do |c|%>
<tr>
<td>
<%=h c.name%>
</td>
<%= javascript_include_tag :defaults %>
<%= periodically_call_remote(:update => "log_entry", :url => {:action
=> 'get_ping_entry', :id => c.id}, :frequency =>3) %>
<td>
<div id="log_entry">
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= will_paginate @devices %>
</body>
</html>
kindly help!!
thanx in advance!