# Relations - data not saved

**URL:** <https://www.ruby-forum.com/t/relations-data-not-saved/137814>\
**Category:** Rails\
**Created:** [May 16, 2008, 4:17pm UTC](https://www.ruby-forum.com/t/relations-data-not-saved/137814 "2008-05-16T16:17:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![san1981](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@san1981](https://www.ruby-forum.com/u/san1981)\
**Post date:** [May 16, 2008, 4:17pm UTC](https://www.ruby-forum.com/t/relations-data-not-saved/137814/1 "2008-05-16T16:17:49Z")

</div>

Hello,

I’ve created 2 databases with a relation 1-N, for example 1 table  
“tasks” and 1 table “categories”, I’ve done the relation 1-N (in task.rb  
belongs\_to :category and in category.rb has\_many :tasks) and I’ve  
created a form to have the possibility to choose a category in a  
dropdown list when I create a task. The creation of a new task is well  
done but without the field “category\_id” stays empty?

Does someone help me with this problem? I really don’ understand  
because another relation with the same principle works fine…

Thanks you
