All, I was trying to use "form_remote_tag" to submit a form Ajax and also I want some javascript code generated by the target view being executed when the Ajax call is complete. I used following code <%= form_remote_tag(:url => {:action => :create}), :complete => "eval(request.responseText)"%> <%= render :partial => ''form'' %> <%= submit_tag ''Save'' %> <%= end_form_tag %> But the for_remote_tag won''t even being rendered, do I miss something here? Thanks -- 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 -~----------~----~----~----~------~----~------~--~---
anakintang wrote:> All, > > I was trying to use "form_remote_tag" to submit a form Ajax and also I > want some javascript code generated by the target view being executed > when the Ajax call is complete. I used following code > > <%= form_remote_tag(:url => {:action => :create}), :complete => > "eval(request.responseText)"%> > <%= render :partial => ''form'' %> > <%= submit_tag ''Save'' %> > <%= end_form_tag %>What version of rails are you using? For rails 1.2+ you should use <% form_remote_tag %> and NOT <%= form_remote_tag %> My guess is you are on rails 1.1+. Any reason why you are not using 1.2? What is generated in the html page (View source) for the form? -- 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 -~----------~----~----~----~------~----~------~--~---
Chet Sanders wrote:> anakintang wrote: >> All, >> >> I was trying to use "form_remote_tag" to submit a form Ajax and also I >> want some javascript code generated by the target view being executed >> when the Ajax call is complete. I used following code >> >> <%= form_remote_tag(:url => {:action => :create}), :complete => >> "eval(request.responseText)"%> >> <%= render :partial => ''form'' %> >> <%= submit_tag ''Save'' %> >> <%= end_form_tag %> > > What version of rails are you using? For rails 1.2+ you should use > <% form_remote_tag %> > and NOT > <%= form_remote_tag %> > > My guess is you are on rails 1.1+. Any reason why you are not using 1.2? > > What is generated in the html page (View source) for the form?I am using 1.2.3 rails. What is the new syntax? Just take out "=" like below? <% form_remote_tag(:url => {:action => :create}), :complete => "eval(request.responseText)"%> <%= render :partial => ''form'' %> <%= submit_tag ''Save'' %> <% end_form_tag %> -- 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 -~----------~----~----~----~------~----~------~--~---
anakintang wrote:> Chet Sanders wrote: >> anakintang wrote: >>> All, >>> >>> I was trying to use "form_remote_tag" to submit a form Ajax and also I >>> want some javascript code generated by the target view being executed >>> when the Ajax call is complete. I used following code >>> >>> <%= form_remote_tag(:url => {:action => :create}), :complete => >>> "eval(request.responseText)"%> >>> <%= render :partial => ''form'' %> >>> <%= submit_tag ''Save'' %> >>> <%= end_form_tag %> >> >> What version of rails are you using? For rails 1.2+ you should use >> <% form_remote_tag %> >> and NOT >> <%= form_remote_tag %> >> >> My guess is you are on rails 1.1+. Any reason why you are not using 1.2? >> >> What is generated in the html page (View source) for the form? > > I am using 1.2.3 rails. What is the new syntax? Just take out "=" like > below? > > <% form_remote_tag(:url => {:action => :create}), :complete => > "eval(request.responseText)"%> > <%= render :partial => ''form'' %> > <%= submit_tag ''Save'' %> > <% end_form_tag %>Now I changed to use the new syntax and it works fine. Thanks a lot! <% form_remote_tag(:url => {:action => :create}, :complete => "eval(datasets_tab_handler())") do -%> <%= render :partial => ''form'' %> <%= submit_tag ''Save'' %> <% end -%> -- 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 -~----------~----~----~----~------~----~------~--~---