I have a form defined in a view : <% form_remote_tag( :url =>{:action => ''list'' }, :html => {:id => ''prop_search_form'', :name => "prop_search_form"}) do %> .... <% end %> when submitted, the check in list action of the controller is not performed if request.xml_http_request? render :partial => ''result_area'', :layout => ''false'' end debugging gives : request.xml_http_request? => false why ? the html code generated seems to be correct : <form action="/proposals/list/22218" id="prop_search_form" method="post" name="prop_search_form" onsubmit="new Ajax.Request(''/proposals/list/22218'', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;"> where am I wrong ? thanks for your help -- 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 -~----------~----~----~----~------~----~------~--~---
for one - you are looking for request.xhr instead of request.xml_http_request? see page 542 of the agile web development book. On 5/2/07, Kad Kerforn <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > I have a form defined in a view : > > <% form_remote_tag( :url =>{:action => ''list'' }, :html => {:id => > ''prop_search_form'', :name => "prop_search_form"}) do %> > .... > <% end %> > > when submitted, the check in list action of the controller is not > performed > > if request.xml_http_request? > render :partial => ''result_area'', :layout => ''false'' > end > > debugging gives : > request.xml_http_request? => false > > why ? > > the html code generated seems to be correct : > > <form action="/proposals/list/22218" id="prop_search_form" method="post" > name="prop_search_form" onsubmit="new > Ajax.Request(''/proposals/list/22218'', {asynchronous:true, > evalScripts:true, parameters:Form.serialize(this)}); return false;"> > > where am I wrong ? > > thanks for your help > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Ivor Paul wrote:> for one - you are looking for request.xhr instead of > request.xml_http_request? see page 542 of the agile web development > book.thanks I thought request.xhr? and request.xml_http_request? were equivalent ... -- 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 -~----------~----~----~----~------~----~------~--~---
Ivor Paul wrote:> for one - you are looking for request.xhr instead of > request.xml_http_request? see page 542 of the agile web development > book.Well I see what could be the problem even if I don"t know yet teh solution : I am using a form_remote_tag, but I am not using a submit button.... instead, as I have a rollover button I use a link w onclick :submit() <div id="btn_search"> <span id="search"><a href="#" onclick="document.prop_search_form.submit();">search</a></span> </div> could it be the problem ? -- 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 -~----------~----~----~----~------~----~------~--~---