Categories
Ruby on Rails The Odin Project

How to Delete from a Join Table in Rails

While working on a project within theOdinProject’s curriculum, I found myself facing a challenge: How to create a link in my Rails app that would delete the record in the join table that establishes a relationship between two objects. In my specific project, “private-events,” I had several users, and several events, which were connected through a join table of invitations. My goal was to build a dynamic link to delete the record in the join table that connects the user with the event he was attending.