On 15 Mar 2010, at 13:28, Veena Jose wrote:

  I want to know how a part of the webpage (data obtained from
database) can be refreshed at periodic intervals(say 5 sec).
I have tried periodically_call_remote() method.But it is not working
for me.

<% periodically_call_remote(:url => { :action =>
:show_readings_for_station },
:frequency => 5, :update => "reading_list")%>
<div id="reading_list">
  #my code here which obtains data from database
</div>

show_readings_for_station is a method in the controller.....

You need to render the periodical executer in the page, so two things that should do it:

- Add the call to periodical updater after your div element
- use <%= instead of just <%

<div id="reading_list">
# render the partial here, render the same partial from your show_readings_for_station method
</div>
<%= periodically_call_remote(:url => { :action => :show_readings_for_station }, :frequency => 5, :update => "reading_list")%>


Best regards

Peter De Berdt

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to