Topic: Push object into array on view

I'm working on a project for my university where I need to make a database of teachers and subjects, relating both of these on a many-to-many relation.

I wrote the models and created the join table, via has_and_belongs_to_many, and what I wanted to do is find a way to add a teacher to a subject, or a subject to a teacher, in the view.

My idea would be to have , for example, an option to