views:

25

answers:

2

I am attempting to reload a partial on a page periodically but it does not seem to be working. The partial loads correctly when I first load the page but it will not update when I introduce new info to it without reloadig the page. The view looks like:

<div id="menuarea"style="height: 399px; width: 181px">

 <%=periodically_call_remote(:url => {:action => :findnew}, :frequency => '20', :update => 'menuarea') %>


  <p> Please select a color </p>
<%#partil renders the color table %>
<%= render :partial => "colortable"  %>
</div>

and the controller looks like:

def findnew
  @bunny= Xparsing::Xmlparse.new

@fuzzybunny= @bunny.hex1

@[email protected]
@[email protected]
render(:partial => 'colortable')
end

All I am attemptinging to do is reload the partial colortable without reloading the page. I am seeing the render color table in the comand line every 20 seconds but the table is not reloading on the page What do I need to fix?

+1  A: 

Are you sure you are not overwriting the Javascript containing periodically_call_remote when you update the <div>?

Don't you want to put that script outside the updating <div>? Or put it into the partial and remove it from where you have it now.

bjg
no dice on these. I tried putting the periodically_call_remote outside of the <div> and put it in the partial and it still did not update with changes from the xml file.
Anthony
At this point I would recommend trying to debug this in the browser. I would use Firefox with the Firebug extension but you might prefer something similar in a different browser. The point is that this will allow you to see the server transfers and how your page is being updated live and if there are any javascript errors, etc.
bjg
A: 

turns out it was an issue with jquery and prototype. I removed jquery and it worked perfectly. Still trying to figure out why

Anthony