thanks everyone, I am using an autocomplete text field with associations following ryan bates rails cast #102. What i would like is when I autocomplete a customer name for their "customer address" to show up in an editable text field below. i''m currently using an observe_field, but not sure if this is the right way. [code] <%= text_field_with_auto_complete :workorder, :customer_name, {}, { :url => formatted_customers_path(:js), :method => :get, :with => "''search='' + element.value" } %><br /> <%= observe_field :workorder_customer_name, :url => { :controller => :customers, :action => :results }, :frequency => 3 %> [/code] and i''ve been playing around with some rjs and partials with no success. I am very new to RoR, so any help would be appreciated, but it may have to be "dumbed down" :) thanks for your time. -- 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 -~----------~----~----~----~------~----~------~--~---
internetchris1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Dec-06 17:25 UTC
Re: Please help newb - observe_field?
Hi Richard, I have been posting like crazy to get achieve the same functionality. I found the autocomplete doesn''t use a regular input tag so you can''t use observe_field on an autocomplete field. I did however find an auto- complete plugin that will pass the id from the model so you can use the id to lookup your information. I''m not sure how to implement it however. Once I get that info, I''ll let you know what I came up with. Here''s the link to the plugin, and if you already found this, or know what to pass to the observe_field, I would be very thankful. http://model-ac.rubyforge.org/ modelautocompleter is the name. On Nov 6, 12:53 pm, Richard Scott <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> thanks everyone, > > I am using an autocomplete text field with associations following ryan > bates rails cast #102. > > What i would like is when I autocomplete a customer name for their > "customer address" to show up in an editable text field below. > > i''m currently using an observe_field, but not sure if this is the right > way. > > [code] > > <%= text_field_with_auto_complete :workorder, :customer_name, {}, { :url > => formatted_customers_path(:js), :method => :get, :with => "''search='' + > element.value" } %><br /> > <%= observe_field :workorder_customer_name, > :url => { :controller => :customers, :action => :results }, > :frequency => 3 > %> > [/code] > > and i''ve been playing around with some rjs and partials with no success. > I am very new to RoR, so any help would be appreciated, but it may have > to be "dumbed down" :) > > thanks for your time. > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Chris, I''ve looked at that plugin and couldn''t firgure it out. not much documentation for it. But it does seem like it does what I would like. Thanks for the response, keep me posted on what you find, and I''ll do the same. -- 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 -~----------~----~----~----~------~----~------~--~---