Sandeep Gudibanda
2009-Jan-19 15:23 UTC
Calling a remote method on choosing an item from Select
Hi, Is there a way where in I can trigger remote action when an user choose one of the options in the dropdown of "select" method? Mebbe something like on_change but instead of triggering JS action, remote action is what i am looking at. Please suggest Regards, Sandeep -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2009-Jan-19 16:46 UTC
Re: Calling a remote method on choosing an item from Select
On 19 Jan 2009, at 15:23, Sandeep Gudibanda wrote:> > Hi, > > Is there a way where in I can trigger remote action when an user > choose > one of the options in the dropdown of "select" method? > > Mebbe something like on_change but instead of triggering JS action, > remote action is what i am looking at. > > Please suggest >onchange is what you want. the javascript in there should make an ajax request. Fred> > Regards, > Sandeep > -- > 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 -~----------~----~----~----~------~----~------~--~---
Sandeep Gudibanda
2009-Jan-19 19:29 UTC
Re: Calling a remote method on choosing an item from Select
Thanks Fred. I used something like this: {:onchange => ''window.location=this.value;''} the value of the select option can be made text link. So it worked like a charm for me to load a new page on selecting an option. -- 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 -~----------~----~----~----~------~----~------~--~---