Hello, Just would like to know how I can refresh a div with formatted text ( html code ) on user onclick action on menu items. I guess I could to this with prototype but should I use the link_remote_tag ? In my case there''s no need to a make a remote ajax call to whatever controller action but only put pre-defined formatted text in a div. Regards, Joel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
For the user onclick action you can use replace(). (or replace_html depending on whether you want to keep your div or not.) Something like: <input type="button" value="Update" <%"onclick=$(div_id).replace(<h1>Hello</h1>);" %>> Hope this helps, Alan On Thu, May 1, 2008 at 2:58 PM, joel <joel.sooriah-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello, > > Just would like to know how I can refresh a div with formatted text > ( html code ) on user onclick action on menu items. I guess I could to > this with prototype but should I use the link_remote_tag ? In my case > there''s no need to a make a remote ajax call to whatever controller > action but only put pre-defined formatted text in a div. > > Regards, > > > Joel > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Have a look at link_to_function--that will write client-side javascript that doesn''t bother the server. -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of joel Sent: Thursday, May 01, 2008 12:59 PM To: Ruby on Rails: Talk Subject: [Rails] Refreshing a div with preformated text Hello, Just would like to know how I can refresh a div with formatted text ( html code ) on user onclick action on menu items. I guess I could to this with prototype but should I use the link_remote_tag ? In my case there''s no need to a make a remote ajax call to whatever controller action but only put pre-defined formatted text in a div. Regards, Joel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---