Palani Kumar
2008-Nov-19 13:54 UTC
pass text_field_with_auto_complete value into link_to_remote
Hi, please any one tell me how can i pass the text_field_with_auto_complete value into link_to_remote in view. Here are the coding in view . <%= text_field_with_auto_complete :game, :title%> link_to_remote("Find", :url => {:controller => ''account'', :action => "findyourgame"},:with =>"''game[title]=''$(''game_title'').value") In my account controller : i have a action called "findyougame" def findyourgame ## i here couldn''t get the value like params[:game][:title]. end Can any one please tell me how can i pass the text value and get in my controller by using link_to_remote. not form submit. -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Nov-19 14:05 UTC
Re: pass text_field_with_auto_complete value into link_to_remote
On 19 Nov 2008, at 13:54, Palani Kumar wrote:> > Hi, > please any one tell me how can i pass the > text_field_with_auto_complete value into link_to_remote in view. Here > are the coding in view . > <%= text_field_with_auto_complete :game, :title%> > > link_to_remote("Find", :url => {:controller => ''account'', :action => > "findyourgame"},:with =>"''game[title]=''$(''game_title'').value")Your with clause is messed up (it needs to be syntactically correct javascript). You''re probably get a javascript error somewhere when you click on the link. Something like "''game[title]='' + $(''game_title'').value" would probably work better. Fred> > In my account controller : i have a action called "findyougame" > > def findyourgame > ## i here couldn''t get the value like params[:game][:title]. > end > > > Can any one please tell me how can i pass the text value and get in my > controller by using link_to_remote. not form submit. > -- > 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 -~----------~----~----~----~------~----~------~--~---