Got a naive question, and I don''t know what keywords to search for on google. I have a webform that needs to query a database in realtime with javascript. So if I press a button, it will query a database and return the result to the webpage without reloading the webpage. It should use ajax. I assume rails have some sort of ajax-y type of thing that makes this query possible. What is this called? I don''t know what terms to type into google. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
the most simple way to do this would be link_to_remote http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M000958 this makes an ajax call to the controller/action on the server, which then can make the db query and render the results. but there are many commands and ways to do this, depending on your needs -- 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 -~----------~----~----~----~------~----~------~--~---
To do what, exactly? Quoting is handy! Julian. Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) VIDEO #3 OUT APRIL 6 http://sensei.zenunit.com/ On 04/04/2008, at 3:53 AM, Thorsten Mueller wrote:> > the most simple way to do this would be link_to_remote > http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M000958 > > this makes an ajax call to the controller/action on the server, which > then can make the db query and render the results. > but there are many commands and ways to do this, depending on your > needs > -- > 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 -~----------~----~----~----~------~----~------~--~---
The thing you''re after is most likely observe_field. Things to remember when using AJAX are that you need to include the default javascripts in your layout, and to look at the log files a lot when debugging it. Using RJS templates is easier than using the :update argument on the observe_field helper tag. Julian. Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) VIDEO #3 OUT APRIL 6 http://sensei.zenunit.com/ On 04/04/2008, at 3:49 AM, Stever wrote:> > Got a naive question, and I don''t know what keywords to search for on > google. > > I have a webform that needs to query a database in realtime with > javascript. So if I press a button, it will query a database and > return the result to the webpage without reloading the webpage. It > should use ajax. > > I assume rails have some sort of ajax-y type of thing that makes this > query possible. What is this called? I don''t know what terms to type > into google. > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---