Topic: understanding many to many relationships
I'm trying to create a messaging system as part of an app I'm building. I have a user model and a message model. I want to make it so that one User can send a Message to one or many other users dependent on which checkbox they click.
My models so far are like so:
from_id (User from)
to_id (User to)
other devise stuff...
What I'm struggling with is how to relate the two models to make it so that one message has one sender ID but can be sent to multiple other users.
Can someone help me out with how I might best achieve this please?