Forum: Ruby on Rails Please help newb - observe_field?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0a79bcb96ce99c9ea981487e1b1e9814?d=identicon&s=25 Richard Scott (richardscott)
on 2008-11-06 20:53
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.
D0b55f385fc038fc7fc588a9c59c3618?d=identicon&s=25 internetchris1@gmail.com (Guest)
on 2008-12-06 19:19
(Received via mailing list)
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...@andreas-s.net>
0a79bcb96ce99c9ea981487e1b1e9814?d=identicon&s=25 Richard Scott (richardscott)
on 2008-12-06 19:31
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.
This topic is locked and can not be replied to.