Right now if you have a contact added to multiple groups like
Group 1
Person A
Person B
Group 2
Person A
Person B
and you go to remove Person A from Group 1, if you added them to Group 2 last, it removes them from that group and does not remove the one you specify(unless you just happened to want to remove them from the most recent group they had been added to). You'll end up with the following result
Group 1
Person A
Person B
Group 2
Person B
Obviously this is not user-friendly. So we need to do something to ensure that when we delete the ContactGroup joined table, we also pass in the group.
Right now the link_to is passing in the contact ID through the params, and we just do a find_by(contact: params[:id]) to get the first record.
When you remove a contact from a group
Right now if you have a contact added to multiple groups like
and you go to remove Person A from Group 1, if you added them to Group 2 last, it removes them from that group and does not remove the one you specify(unless you just happened to want to remove them from the most recent group they had been added to). You'll end up with the following result
Obviously this is not user-friendly. So we need to do something to ensure that when we delete the ContactGroup joined table, we also pass in the group.
Right now the link_to is passing in the contact ID through the params, and we just do a find_by(contact: params[:id]) to get the first record.
Need to fix.