# Combobox and m:n relation

**URL:** <https://www.ruby-forum.com/t/combobox-and-m-n-relation/123165>\
**Category:** Rails\
**Created:** [December 14, 2007, 4:16pm UTC](https://www.ruby-forum.com/t/combobox-and-m-n-relation/123165 "2007-12-14T16:16:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luixx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/43a26b/32.png) [@luixx](https://www.ruby-forum.com/u/luixx)\
**Post date:** [December 14, 2007, 4:16pm UTC](https://www.ruby-forum.com/t/combobox-and-m-n-relation/123165/1 "2007-12-14T16:16:43Z")

</div>

Hi,

i have a project and a task. both have a m:n relation to each other. I  
made a scaffolding and want to insert a combobox in the task new view

Code : ruby - fold - unfold

```
<label for="project_name_ger">Poject</label><br/>
    <%= select "task[projects_id][]", "project_id",
         Project.find(:all).collect {|c| [c.name_ger, c.id]},
         :prompt => "Select a Category" %>

```

the code does not work. does anyone has an idea how to save the  
combobox’s content. it works for a 1:n relation because i just have to  
save the task which has a projekt\_id but with a m:n relations it is  
different.

thank you
