Does the thought of correctly modeling rich many-to-many associations leave you a little frightened? 👻
Rails has powerful conventions to help you manage these relationships, but the conventions alone only take you so far. It’s up to you to model the associations with the full stack in mind: from the database tables all the way through to the user interface.
But don’t be spooked! 😱
Today we released five new Rails 6 videos that dig into six different examples to chase your scary thoughts away.
Starting in Module #35 we streamline the registration process for currently signed in users by creating our first many-to-many association which connects a user to an event using a join model and a form.
In our second many-to-many association we make it possible for users to like multiple events with a button.
Which leaves us with a question: In the absence of a direct relationship between two models, how do you efficiently traverse between them? Thankfully, Rails offers a really convenient way: through associations. They can seem a bit magically at first, but we quickly dispel any confusion.