Nested forms without looping through fields_for collection.


I have a fairly complex form and I am wondering if it is even possible to do what I am attempting.

I have multiple models included in the form. A small example would be the following:

Company has many Locations Company has many PhoneNumbers... and so on

I have this working without issue using Rails 2.3 and nested forms.

Where this becomes complex is that I also have another model named Rankings. I allow my users to assign a raking to each of the fields that are entered. Each model has a has many :through relationship with Rankings. I wish to send these fields back to the server in a nested format with the attribute that they belong to, as well as with the field name that they are being assigned to. I have attempted to use a fields_for, but it simply loops through the entire set of Rankings duplicating each of the attributes multiple times.

Does anyone have a suggestion to implement this?