Peter Jeppesen
2009-Jan-06 13:53 UTC
:after_update_element and text_field_with_auto_complete
Hi! I''m on Rails 2.2.2 and using text_field_with_auto_complete which works fine. Now I want to use :after_update_element to send some data back to the server when my text field is updated. I have the following code in my view: <%= text_field_with_auto_complete :company, :name, {}, {:after_update_element => "function(element,value){" + remote_function( :url => { :action => :update_search_session }, :with =>"''selected_company_name=''+element.value") + "}", :skip_style => false, :method => :get } %> I can see that my controller method (:update_search_session) gets called allright but I can''t figure out how to access the returned data (element.value). Can anyone help? TIA, Peter -- 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 -~----------~----~----~----~------~----~------~--~---
Peter Jeppesen
2009-Jan-07 18:34 UTC
Re: :after_update_element and text_field_with_auto_complete
Am I totally misunderstanding something here or... Please help! - I''m really stuck on this! -- 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 -~----------~----~----~----~------~----~------~--~---
Peter Jeppesen
2009-Jan-08 18:31 UTC
Re: :after_update_element and text_field_with_auto_complete
Peter Jeppesen wrote:> Am I totally misunderstanding something here or... > Please help! - I''m really stuck on this!OK finally I got it sorted out. After a minor bugfix in my javascript, params[:selected_company_name] did the trick. Amazing and smooth... - I just love Rails! Peter -- 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 -~----------~----~----~----~------~----~------~--~---