Hi anybody plz help me how can i use link_to_remote with in form_for.. i tried but no luck... if i use form_tag i can able to use link_to_remote and made ajax call.but i need to use form_for ....can anyone help me how can i do with this.Thanks in advance. -- 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 -~----------~----~----~----~------~----~------~--~---
On 14 Jul 2008, at 16:23, Palani Kumar wrote:> > Hi > anybody plz help me how can i use link_to_remote with in > form_for.. i > tried but no luck... if i use form_tag i can able to use > link_to_remote > and made ajax call.but i need to use form_for ....can anyone help me > how > can i do with this.Thanks in advance.A little detail would help (ie what doesn''t work if you just bung a link_to_remote in your form ?) Fred> > -- > 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 -~----------~----~----~----~------~----~------~--~---
why not use form_remote_for ? gives you an ajax call to and the form_for stuff anyway, please give us more details, what you want to do, and/or what exactly your problem is. for link_to_remote it doesn''t matter, if it''s within a form or not and it''ll display & work as everywhere else. so if you have problems, they''re specific to your code. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Palani Kumar wrote:> Hi > anybody plz help me how can i use link_to_remote with in form_for.. i > tried but no luck... if i use form_tag i can able to use link_to_remote > and made ajax call.but i need to use form_for ....can anyone help me how > can i do with this.Thanks in advance.Hi Actually i work user avilability check.ie) the newuser choose the username and check whether his username already available or not. my form looks:- <% form_for :user,@user, :url => {:controller => ''account'', :action => ''signup_new''} do |f| %> <tr> <td align=right><label for="choose_username">Choose Username : </label></td> <td align=left ><%= f.text_field ''username'', :class => "text-n", :tabindex => 2 %></td> <td> <% link_to_remote "check",url => {:controller => ''account'',:action =>''Available''},:with => "''user_name=''+$F(''username'')",:complete => ''alert(request.responseText)''</td> </tr> In controller: def Available @u= User.find_by_username(params[:user_name]) if @u !=nil if request.xhr? render(:text => "User Name Already exist" , :layout => false) else render(:text => "User Name doesn''t exist ",:layout => false ) end end end If i use form_tag it works fine (ie.Alert box popup with ajax response message)...If I use form_for_remote,form_remote_for the ajax call doesn''t made this is my exact problem. I need use the form which involves model also. -- 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 -~----------~----~----~----~------~----~------~--~---
On 14 Jul 2008, at 17:12, Palani Kumar wrote:> > <% form_for :user,@user, :url => {:controller => > ''account'', :action > => ''signup_new''} do |f| %> > <tr> > <td align=right><label for="choose_username">Choose Username : > </label></td> <td align=left ><%= f.text_field ''username'', :class > => > "text-n", :tabindex => 2 %></td> <td> > <% link_to_remote "check",url => {:controller => ''account'',:action > =>''Available''},:with => "''user_name=''+$F(''username'')",:complete => > ''alert(request.responseText)''</td>The problem here is that the id of your username textfield isn''t username (it will be something like user_username). Check your html. Fred --~--~---------~--~----~------------~-------~--~----~ 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 wrote:> On 14 Jul 2008, at 17:12, Palani Kumar wrote: >> =>''Available''},:with => "''user_name=''+$F(''username'')",:complete => >> ''alert(request.responseText)''</td> > > The problem here is that the id of your username textfield isn''t > username (it will be something like user_username). Check your html. > > FredHi Fred Thank you so much man......now its working for me... the is error exactly what you specify. Thanks you so much -- 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 -~----------~----~----~----~------~----~------~--~---