I have added a multiple select box like this one to my form HTML multiple select box.
I have a User object and a Personality object. A user can have 0 or more personalities and a personality can "belong" to 0 or more users. For this many to many relation I created a third model UserPersonality to store the ids of the User and Personality.
My User and Personality models have their corresponding has_many through
indications. My question is, how can I make the helper add the association to the UserPersonality table through a select box like the one on the left from the link provided?
If a user adds a personality from the right select box to the left box I want to add a record such as:
UserId PersonalityId
1 3
To connect a User with the Personality that is selected.
Thanks.