users (id, name, ...)
user_emails (id, user_id, email, email_type)
email_type is either work | home
User has multiple email objects (home, work).
I want to add or remove emails when the user selects the add or remove buttons.
This needs to be done in a dynamic fashion.
How would I go about creating my form so that new objects can be created or existing email objects can be removed.
I had to do just this recently and would recommend the Nested Form episodes from Railscasts.
Here’s Episode 1 – http://railscasts.com/episodes/196-nested-model-form-part-1