# Managing relationships in the form

**URL:** <https://discuss.rubyonrails.org/t/managing-relationships-in-the-form/42569>\
**Category:** rubyonrails-talk\
**Created:** [May 16, 2009, 10:21am UTC](https://discuss.rubyonrails.org/t/managing-relationships-in-the-form/42569 "2009-05-16T10:21:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prabesh\_shrestha](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@prabesh\_shrestha](https://discuss.rubyonrails.org/u/prabesh_shrestha)\
**Post date:** [May 16, 2009, 10:21am UTC](https://discuss.rubyonrails.org/t/managing-relationships-in-the-form/42569/1 "2009-05-16T10:21:20Z")

</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.
