Nested Form find or create inside of form

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Nested Form find or create inside of form

Good morning,

I haven’t done an autocomplete with a nested form in quite some time and can’t find any good references.  I posted to SO here:

Basically I have two models Run and Patient.  Run belongs_to patient and Patient has_many runs.  Run accepts_nested_attributes for patient.

What I want to do is when creating a new run, have a select box that let’s me type out of the name of the patient, if they exist and it’s the right patient, use that ID in the form.  If the patient does not exist, then create the nested association patient record.  I’m hoping to do this with autocomplete too.

Any guidance is greatly appreciated.


You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit
For more options, visit