Hi, I wish to know, is it possible that Ajax can update more than one zone "<div>"???? like : <%= link_to_remote("Title", :update => ''mydiv0'', :url => {:action=>:say_hello} )%> <div id="mydiv0"> to be changed one</div> <div id="mydiv0"> to be changed two</div> When I execute the code, only the first line is changed, the second one doesn''t... thanks you very much Saiho __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
The link_to_remote will only update one DOM element. You may want to look into RJS templates...they will allow you to do multiple updates on a single AJAX call. -Derrick Spell On Feb 14, 2006, at 1:57 PM, Saiho Yuen wrote:> Hi, > > I wish to know, is it possible that Ajax can update > more than one zone "<div>"???? like : > > > <%= link_to_remote("Title", :update => ''mydiv0'', :url > => {:action=>:say_hello} )%> > > <div id="mydiv0"> to be changed one</div> > <div id="mydiv0"> to be changed two</div> > > When I execute the code, only the first line is > changed, the second one doesn''t... > > > thanks you very much > > Saiho > > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
There is a section in "Rails Recipes" that talks about using RJS to do this. Derrick Spell wrote:> The link_to_remote will only update one DOM element. You may want to > look into RJS templates...they will allow you to do multiple updates > on a single AJAX call. > > -Derrick Spell > > On Feb 14, 2006, at 1:57 PM, Saiho Yuen wrote: > >> Hi, >> >> I wish to know, is it possible that Ajax can update >> more than one zone "<div>"???? like : >> >> >> <%= link_to_remote("Title", :update => ''mydiv0'', :url >> => {:action=>:say_hello} )%> >> >> <div id="mydiv0"> to be changed one</div> >> <div id="mydiv0"> to be changed two</div> >> >> When I execute the code, only the first line is >> changed, the second one doesn''t... >> >> >> thanks you very much >> >> Saiho >> >> >> >> >> >> __________________________________________________ >> Do You Yahoo!? >> Tired of spam? Yahoo! Mail has the best spam protection around >> http://mail.yahoo.com >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Ditto to both comments above. I was looking for the exact same thing, and RJS seems to be one of the only sane ways to do this. On 2/14/06, Jeff de Vries <jdevries@pfrog.com> wrote:> > There is a section in "Rails Recipes" that talks about using RJS to do > this. > > Derrick Spell wrote: > > The link_to_remote will only update one DOM element. You may want to > > look into RJS templates...they will allow you to do multiple updates > > on a single AJAX call. > > > > -Derrick Spell > > > > On Feb 14, 2006, at 1:57 PM, Saiho Yuen wrote: > > > >> Hi, > >> > >> I wish to know, is it possible that Ajax can update > >> more than one zone "<div>"???? like : > >> > >> > >> <%= link_to_remote("Title", :update => ''mydiv0'', :url > >> => {:action=>:say_hello} )%> > >> > >> <div id="mydiv0"> to be changed one</div> > >> <div id="mydiv0"> to be changed two</div> > >> > >> When I execute the code, only the first line is > >> changed, the second one doesn''t... > >> > >> > >> thanks you very much > >> > >> Saiho > >> > >> > >> > >> > >> > >> __________________________________________________ > >> Do You Yahoo!? > >> Tired of spam? Yahoo! Mail has the best spam protection around > >> http://mail.yahoo.com > >> _______________________________________________ > >> Rails mailing list > >> Rails@lists.rubyonrails.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails > >> > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060214/073d6f16/attachment-0001.html