I am trying to reload a partial contained inside a Foundation tab every few seconds.
apps/views/xrf_cocs/show.html.erb - This is where I'm initially rendering the partial
<div class="tabs-panel" id="panel6v" style="border-left: solid 1px #f2f2f2">
<%= render 'lead_reports/index' %>
</div>
apps/controllers/xrf_cocs_controller.rb - This is where I'm populating the rails objects for the partial
def show
@positive_lead_reports = LeadReport.all.to_a
@positive_lead_reports.delete_if{|cur| cur.xrf_coc_id != @xrf_coc.id}
@negative_lead_reports = LeadReportNeg.all.to_a
@negative_lead_reports.delete_if{|cur| cur.xrf_coc_id != @xrf_coc.id}
end
apps/views/lead_reports/_index.html.erb - This is the gist of the code inside the partial
<div id="lead_reports">
<% @positive_lead_reports.each do |lead_report| %>
<table>
<thead>
</thead>
<tbody>
</tbody>
</table>
<% end %>
... repeat above for negative reports
</div>
Basically I'm trying to add a jQuery function inside my apps/views/xrf_cocs/show.html.erb
file that will call the render 'lead_reports/index'
every 3 seconds.
Can anyone offer some help with this?