Hi all , I have to refresh three div in a single ajax call ... Anybody having any Idea . Please let me help , It would be great for me. Thanks In Advance -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Kumar Saurav wrote:> Hi all , > > I have to refresh three div in a single ajax call ... > Anybody having any Idea . Please let me help , It would be great for me. > > Thanks In AdvanceI use render :update in my action. For example, if I have a drop down of stuff and I want to add to a list when I select something from that drop down but at the say time remove from the drop down what I just selected I would say something like: render :update do |x| page.replace_html ''stuff_to_select'', :partial => ''partial_1'' page.replace_html ''list_of_stuff, :partial => ''partial_2'' page.replace_html ''message'', :inline => ''Stuff updated'' end Assuming that you have the divs names correctly this would update two partials and display a message in another. I usually use these in conjunction with link_to_remote or remote_form_tag. If you are using these helpers, don''t include the :update option in your helper as you will get strange output displayed in your divs. Hope this helps, -S -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Shandy Nantz wrote:> Kumar Saurav wrote: >> Hi all ,> > I use render :update in my action. For example, if I have a drop down of > stuff and I want to add to a list when I select something from that drop > down but at the say time remove from the drop down what I just selected > I would say something like: > > render :update do |x| > page.replace_html ''stuff_to_select'', :partial => ''partial_1'' > page.replace_html ''list_of_stuff, :partial => ''partial_2'' > page.replace_html ''message'', :inline => ''Stuff updated'' > endHi thanks for help but i am using form_remote_tag on my page and updating the div there . The code is <%= form_remote_tag({:url=>{:controller=>''image_builders'', :action =>''image_creation''}, :update =>''photo'', :html=>{:onsubmit=>''UrlGeneration(this)''}})%> And I have to update the Div(sample1,sample2,sample4) here like photo i updating . Do you have any suggestion, if yes please let me know. Thanks In Advance -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---