Hi, I would to know if it is possible to automaticly refresh some particular field ? Clearly, I have a model called "productions" with fileds "name" and "numbers". Another application update fields "numbers" of the mysql table. On an "index.html.erb", I have the list of "production" and i would like to view automaticly when value of "numbers" change. First of all, is it possible ? Because I may have many records, and in a close futur, more fields to monitor, I would like to update just choosen filed and not the whole page. Thanks in advance. PS : I just begun with ror... --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hello, Look at the prototype helper : periodically_call_remote It will call an action each X second. In this action, you should have a render like : render :update do |page| page[''my_field_id''].replace_html "<p>updated!</p>" end On Sep 24, 4:14 am, Alex2101 <legars2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I would to know if it is possible to automaticly refresh some > particular field ? > Clearly, I have a model called "productions" with fileds "name" and > "numbers". > Another application update fields "numbers" of the mysql table. > On an "index.html.erb", I have the list of "production" and i would > like to view automaticly when value of "numbers" change. > > First of all, is it possible ? > Because I may have many records, and in a close futur, more fields to > monitor, I would like to update just choosen filed and not the whole > page. > > Thanks in advance. > > PS : I just begun with ror...--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ok, i do understand the idea, but i don''t know where to apply it... 2008/9/24 joserwan <joserwan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > Hello, > > Look at the prototype helper : periodically_call_remote > It will call an action each X second. In this action, you should have > a render like : > > render :update do |page| > page[''my_field_id''].replace_html "<p>updated!</p>" > end > > > On Sep 24, 4:14 am, Alex2101 <legars2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi, > > > > I would to know if it is possible to automaticly refresh some > > particular field ? > > Clearly, I have a model called "productions" with fileds "name" and > > "numbers". > > Another application update fields "numbers" of the mysql table. > > On an "index.html.erb", I have the list of "production" and i would > > like to view automaticly when value of "numbers" change. > > > > First of all, is it possible ? > > Because I may have many records, and in a close futur, more fields to > > monitor, I would like to update just choosen filed and not the whole > > page. > > > > Thanks in advance. > > > > PS : I just begun with ror... > > >-- Cordialement, Alexandre Petitjean --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I finally find how to do : In the controler I create a method : def update_nbpiece @production = Production.find(params[:id]) render :text=>@production.numbers end Then in the index.html.erb, inside the for loop : <%= periodically_call_remote(:update => "nbpiece_id_" + production.id.to_s, :url => {:action => "update_nbpiece", :id=>production.id}, :frequency => 1 )%> ... <td id="nbpiece_id_<%=production.id%>"><%=h production.numbers%></td> ... Now the strange thinks, is that when use the Aptana''s internal browser, it works, but when I run another web browser, like IE or Firefox, I got the following error : *PeriodicalExecuter is not defined<http://www.google.com/url?q=http://www.answers.com/defined&r=67&sa=X&oi=dict&ct=D&cd=1&usg=AFQjCNFuvFJmznBKueoiUXuoQSNCuy0xBA> rails<http://www.google.com/url?q=http://www.answers.com/rails&r=67&sa=X&oi=dict&ct=D&cd=2&usg=AFQjCNHlo-0vsLWU3qaE-1UK1xKYlQhRtg> * Any ideas ?? 2008/9/24 Alexandre Petitjean <legars2101-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> Ok, i do understand the idea, but i don''t know where to apply it... > > 2008/9/24 joserwan <joserwan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > >> Hello, >> >> Look at the prototype helper : periodically_call_remote >> It will call an action each X second. In this action, you should have >> a render like : >> >> render :update do |page| >> page[''my_field_id''].replace_html "<p>updated!</p>" >> end >> >> >> On Sep 24, 4:14 am, Alex2101 <legars2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > Hi, >> > >> > I would to know if it is possible to automaticly refresh some >> > particular field ? >> > Clearly, I have a model called "productions" with fileds "name" and >> > "numbers". >> > Another application update fields "numbers" of the mysql table. >> > On an "index.html.erb", I have the list of "production" and i would >> > like to view automaticly when value of "numbers" change. >> > >> > First of all, is it possible ? >> > Because I may have many records, and in a close futur, more fields to >> > monitor, I would like to update just choosen filed and not the whole >> > page. >> > >> > Thanks in advance. >> > >> > PS : I just begun with ror... >> >> >> > > > -- > Cordialement, > Alexandre Petitjean >-- Cordialement, Alexandre Petitjean --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Maybe Aptana automatically include links to prototype as it misses. You have to include in your page header : <%= javascript_include_tag :all %> or less (don''t know wich file is needed for the updater) : <%= javascript_include_tag ''prototype'' %> Erwan On Sep 25, 4:16 am, "Alexandre Petitjean" <legars2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I finally find how to do : > In the controler I create a method : > def update_nbpiece > @production = Production.find(params[:id]) > render :text=>@production.numbers > end > > Then in the index.html.erb, inside the for loop : > <%= periodically_call_remote(:update => "nbpiece_id_" + production.id.to_s, > :url => {:action => "update_nbpiece", :id=>production.id}, :frequency => 1 > )%> > ... > <td id="nbpiece_id_<%=production.id%>"><%=h production.numbers%></td> > ... > > Now the strange thinks, is that when use the Aptana''s internal browser, it > works, but when I run another web browser, like IE or Firefox, I got the > following error : > *PeriodicalExecuter is not > defined<http://www.google.com/url?q=http://www.answers.com/defined&r=67&sa=X&...> > rails<http://www.google.com/url?q=http://www.answers.com/rails&r=67&sa=X&oi...> > * > Any ideas ?? > > 2008/9/24 Alexandre Petitjean <legars2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > Ok, i do understand the idea, but i don''t know where to apply it... > > > 2008/9/24 joserwan <joser...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > >> Hello, > > >> Look at the prototype helper : periodically_call_remote > >> It will call an action each X second. In this action, you should have > >> a render like : > > >> render :update do |page| > >> page[''my_field_id''].replace_html "<p>updated!</p>" > >> end > > >> On Sep 24, 4:14 am, Alex2101 <legars2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> > Hi, > > >> > I would to know if it is possible to automaticly refresh some > >> > particular field ? > >> > Clearly, I have a model called "productions" with fileds "name" and > >> > "numbers". > >> > Another application update fields "numbers" of the mysql table. > >> > On an "index.html.erb", I have the list of "production" and i would > >> > like to view automaticly when value of "numbers" change. > > >> > First of all, is it possible ? > >> > Because I may have many records, and in a close futur, more fields to > >> > monitor, I would like to update just choosen filed and not the whole > >> > page. > > >> > Thanks in advance. > > >> > PS : I just begun with ror... > > > -- > > Cordialement, > > Alexandre Petitjean > > -- > Cordialement, > Alexandre Petitjean--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
that''s it! Thanks ! 2008/9/25 joserwan <joserwan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > Maybe Aptana automatically include links to prototype as it misses. > You have to include in your page header : > > <%= javascript_include_tag :all %> > > or less (don''t know wich file is needed for the updater) : > > <%= javascript_include_tag ''prototype'' %> > > Erwan > > On Sep 25, 4:16 am, "Alexandre Petitjean" <legars2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > I finally find how to do : > > In the controler I create a method : > > def update_nbpiece > > @production = Production.find(params[:id]) > > render :text=>@production.numbers > > end > > > > Then in the index.html.erb, inside the for loop : > > <%= periodically_call_remote(:update => "nbpiece_id_" + > production.id.to_s, > > :url => {:action => "update_nbpiece", :id=>production.id}, :frequency => > 1 > > )%> > > ... > > <td id="nbpiece_id_<%=production.id%>"><%=h production.numbers%></td> > > ... > > > > Now the strange thinks, is that when use the Aptana''s internal browser, > it > > works, but when I run another web browser, like IE or Firefox, I got the > > following error : > > *PeriodicalExecuter is not > > defined< > http://www.google.com/url?q=http://www.answers.com/defined&r=67&sa=X&...> > > rails< > http://www.google.com/url?q=http://www.answers.com/rails&r=67&sa=X&oi...> > > * > > Any ideas ?? > > > > 2008/9/24 Alexandre Petitjean <legars2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > > > > > Ok, i do understand the idea, but i don''t know where to apply it... > > > > > 2008/9/24 joserwan <joser...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > >> Hello, > > > > >> Look at the prototype helper : periodically_call_remote > > >> It will call an action each X second. In this action, you should have > > >> a render like : > > > > >> render :update do |page| > > >> page[''my_field_id''].replace_html "<p>updated!</p>" > > >> end > > > > >> On Sep 24, 4:14 am, Alex2101 <legars2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> > Hi, > > > > >> > I would to know if it is possible to automaticly refresh some > > >> > particular field ? > > >> > Clearly, I have a model called "productions" with fileds "name" and > > >> > "numbers". > > >> > Another application update fields "numbers" of the mysql table. > > >> > On an "index.html.erb", I have the list of "production" and i would > > >> > like to view automaticly when value of "numbers" change. > > > > >> > First of all, is it possible ? > > >> > Because I may have many records, and in a close futur, more fields > to > > >> > monitor, I would like to update just choosen filed and not the whole > > >> > page. > > > > >> > Thanks in advance. > > > > >> > PS : I just begun with ror... > > > > > -- > > > Cordialement, > > > Alexandre Petitjean > > > > -- > > Cordialement, > > Alexandre Petitjean > > >-- Cordialement, Alexandre Petitjean --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Possibly Parallel Threads
- Newbie question about periodically_call_remote
- Initial load time when periodically_call_remote
- Ajax: periodicaly_call_remote problem
- Call action & display nothing?
- strange bugs while using mongrel, while running in development (and also sometimes in production mode)