hey all, every time the user click on a thumbnail, it gets display into a div like this: page.insert_html :bottom, mydiv image_tag("/img/bigimages/#{@filename}", :alt=>''BacoTP'') it works great. What I would like to do is remove all picture from the div every time the user clicks on another thumbnail. something like: page.flush_all_content mydiv page.insert_html :bottom, mydiv, image_tag("/img/bigimages/#{@filename}", :alt=>''BacoTP'') any idea how to do this? thanx in advance Pat --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sébastien Gruhier
2006-Dec-16 16:34 UTC
Re: how to remove all content from a div with rjs?
page.replace_html should do it instead of page.insert_html On Dec 16, 2006, at 5:25 PM, Patrick Aljord wrote:> hey all, > every time the user click on a thumbnail, it gets display into a > div like this: > > page.insert_html :bottom, mydiv > image_tag("/img/bigimages/#{@filename}", :alt=>''BacoTP'') > > it works great. What I would like to do is remove all picture from > the div every time the user clicks on another thumbnail. > something like: > > page.flush_all_content mydiv > page.insert_html :bottom, mydiv, image_tag("/img/bigimages/# > {@filename}", :alt=>''BacoTP'') > > > any idea how to do this? > > thanx in advance > > Pat > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 12/16/06, Sébastien Gruhier <sgruhier-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > page.replace_html should do it instead of page.insert_htmlyep, just figured it out thanx :) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---