[Rails] Re: refresh a page using AJAX?

2010-03-17 Thread Veena Jose
Hai Robert, Thanks for your help.I have done what you have told me.But the problem is it refreshes only for the first time and shows some RJSerror on the webpage. readings controller def show_current_readings @range=ConfigureParameter.find(:all) if (params[:state] ==) @readings =

Re: [Rails] Re: refresh a page using AJAX?

2010-03-17 Thread Narendra sisodiya
Hi Veena, You are mentioning :update attribute in the ajax call, so in the responding action you do not need to replace the content of the div. Rails will automatically update it. use following code in your controller render :partial='current_readings_list' or the second solution is just

Re: [Rails] Re: refresh a page using AJAX?

2010-03-17 Thread Nitin Rajora
I agree with Naren. Sending name of the div - current_reading as the :update option in the ajax call is enough to automatically replace the contents. No need for explicitly calling replace_html in the action. However if you want to use replace_html in your action... do not send %=

[Rails] Re: refresh a page using AJAX?

2010-03-15 Thread Robert Walker
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 =