# Managing relationships in the form

**URL:** <https://www.ruby-forum.com/t/managing-relationships-in-the-form/168127>\
**Category:** Rails\
**Created:** [May 16, 2009, 12:25pm UTC](https://www.ruby-forum.com/t/managing-relationships-in-the-form/168127 "2009-05-16T12:25:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prabesh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f05b48/32.png) [@prabesh](https://www.ruby-forum.com/u/prabesh)\
**Post date:** [May 16, 2009, 12:25pm UTC](https://www.ruby-forum.com/t/managing-relationships-in-the-form/168127/1 "2009-05-16T12:25:35Z")

</div>

project has\_and\_belongs\_to\_many :users  
user has\_and\_belongs\_to\_many :projectss

Project Managers: \<%= collection\_select(‘project’,  
‘user\_ids’,@resources, :id, :username,{}) %\>  
Users: \<%= collection\_select(‘project’,  
‘user\_ids’,@resources, :id, :username,{},{:multiple =\> true}) %\>

Hi I am a newbie to Ruby and Rails.I am having some problems.I am  
creating a new project in the form and I want to insert some users and  
one project manager for that project.  
If I include only one of the above select it works but and the  
relationship table gets updated but if I use both I am getting “500  
Internal Server Error”.

Can someone get me to some useful tutorials or help in the matter.
