# Help with create/edit form for dynamic objects

**URL:** <https://www.ruby-forum.com/t/help-with-create-edit-form-for-dynamic-objects/125506>\
**Category:** Rails\
**Created:** [January 9, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/help-with-create-edit-form-for-dynamic-objects/125506 "2008-01-09T19:31:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jchengj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d78d45/32.png) [@jchengj](https://www.ruby-forum.com/u/jchengj)\
**Post date:** [January 9, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/help-with-create-edit-form-for-dynamic-objects/125506/1 "2008-01-09T19:31:31Z")

</div>

I have a table called ‘cars’.

## id name

1 Hyundai Accent  
2 Chevy Impala  
3 Merecedes C Class

I would like to know the users opinions on each of these cars, so I have  
setup a table called ‘car\_opinions’:

## id user\_id car\_id opinion

1 1 1 Love it!  
2 1 2 Bumpy ride.  
3 1 3 Too expensive

The create form should look like :

Hyundai Accent : \_\_\_\_\_\_\_\_\_\_\_\_\_  
Chevy Impala : \_\_\_\_\_\_\_\_\_\_\_\_\_  
Mercedes C Class : \_\_\_\_\_\_\_\_\_\_\_\_\_

After creating the records for the user,  
the edit form would look like :

Hyundai Accent : _Love It!_  
Chevy Impala : _Bumpy Ride_  
Mercedes C Class : _Too expensive_

So this isn’t a trivial mapping of column to object. I am mapping a  
dynamic set of objects (the cars) to a dynamic set of opinions.

As far as I can tell, I can’t just use the simple form\_for construct?

Thanks for any help provided.

---

<div class="post-metadata">

**Author:** ![jchengj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d78d45/32.png) [@jchengj](https://www.ruby-forum.com/u/jchengj)\
**Post date:** [January 10, 2008, 4:27pm UTC](https://www.ruby-forum.com/t/help-with-create-edit-form-for-dynamic-objects/125506/2 "2008-01-10T16:27:19Z")

</div>

Any ideas, anyone?
