I am working on a Project where there as two models, (User,Project). They have many to many relationship and is implemented by has_many through which is (UserProject). I want the functionality that when I am creating a project, below projects models fields, all the db users should be listed below having checkbox in front of each. When user enters all the projects model fields and checks the checkboxes for example 2 checkboxes below(2 users), All the data should be saved which includes projects creation as well as two records of UserProject. Is there any way of doing this.. I am using form_with helper. User(id,email,password) Project(id,name) UserProject(id,user_id,project_id)