I was wondering, hypothetically, how I could attach an event handler, like for instance onChange, to trigger an action in my controller. So far, I figured out how to include event handlers, like this "<%start_form_tag({:action=>''update'', :id=>@alert}, :onsubmit=>''getComment()'') %>" But, now, If I want my event handler to trigger an ajax request/ response that works with an action/method in my rails controller, where would I go? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I was wondering, hypothetically, how I could attach an event handler, like for instance onChange, to trigger an action/method in my controller. So far, I figured out how to include event handlers, like so: <%= select (''applicant'', ''marital_status'', {"Single" => "single", "Married" => "married", "Divorced" => "divorced", "Partner" => "partner", "Widowed" => "widowed", "Separated" => "separated"}, :onchange=>''getComment()'') %> but now, is there an elegant way to link to/call an action/method in my controller? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
You probably want to take a look at remote_function... http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M000534 On 5/9/07, Bunsenator <Auston.Bunsen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I was wondering, hypothetically, how I could attach an event handler, > like for instance onChange, to trigger an action/method in my > controller. So > far, I figured out how to include event handlers, like so: > > <%= select (''applicant'', ''marital_status'', {"Single" => "single", > "Married" => "married", "Divorced" => "divorced", "Partner" => > "partner", "Widowed" => "widowed", "Separated" => > "separated"}, :onchange=>''getComment()'') %> > > but now, is there an elegant way to link to/call an action/method in > my controller? > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thats simple! Thanks alot! On May 9, 9:07 pm, "Andrew Kaspick" <akasp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You probably want to take a look at remote_function... > > http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper... > > On 5/9/07, Bunsenator <Auston.Bun...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I was wondering, hypothetically, how I could attach an event handler, > > like for instance onChange, to trigger an action/method in my > > controller. So > > far, I figured out how to include event handlers, like so: > > > <%= select (''applicant'', ''marital_status'', {"Single" => "single", > > "Married" => "married", "Divorced" => "divorced", "Partner" => > > "partner", "Widowed" => "widowed", "Separated" => > > "separated"}, :onchange=>''getComment()'') %> > > > but now, is there an elegant way to link to/call an action/method in > > my controller?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---