# simple nested form question

**URL:** <https://discuss.rubyonrails.org/t/simple-nested-form-question/48881>\
**Category:** rubyonrails-talk\
**Created:** [January 26, 2010, 7:35pm UTC](https://discuss.rubyonrails.org/t/simple-nested-form-question/48881 "2010-01-26T19:35:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![der\_tom](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@der\_tom](https://discuss.rubyonrails.org/u/der_tom)\
**Post date:** [January 26, 2010, 7:35pm UTC](https://discuss.rubyonrails.org/t/simple-nested-form-question/48881/1 "2010-01-26T19:35:27Z")

</div>

hi, im having a 1\<\>N, Bol\<\>BolLines model, and trying to use nested urls, but the form is confusing me..maybe someone can enlighten me:

url: [http://192.168.0.111:3000/bols/6/bol\_lines/new](http://192.168.0.111:3000/bols/6/bol_lines/new)

\<% form\_for @bol\_line do |f| %\> &nbsp;&nbsp;\<%= f.error\_messages %\>

\<!-- PROBLEM &nbsp;&nbsp;\<p\> &nbsp;&nbsp;&nbsp;&nbsp;\<%= f.label :bol\_id %\>\<br /\> &nbsp;&nbsp;&nbsp;&nbsp;\<%= f.text\_field :bol\_id %\> &nbsp;&nbsp;\</p\> \<!-- PROBLEM

&nbsp;&nbsp;\<p\> &nbsp;&nbsp;&nbsp;&nbsp;\<%= f.label :package\_type\_id %\>\<br /\> &nbsp;&nbsp;&nbsp;&nbsp;\<%= f.collection\_select :package\_type\_id, PackageType.all, :id, :title %\> &nbsp;&nbsp;\</p\>

&nbsp;&nbsp;\<p\> &nbsp;&nbsp;&nbsp;&nbsp;\<%= f.label :item\_id %\>\<br /\> &nbsp;&nbsp;&nbsp;&nbsp;\<%= f.collection\_select :item\_id, Item.find(:all, :order =\> :title ), :id, :title %\> &nbsp;&nbsp;\</p\>

&nbsp;&nbsp;\<p\> &nbsp;&nbsp;&nbsp;&nbsp;\<%= f.label :amount\_packages %\>\<br /\> &nbsp;&nbsp;&nbsp;&nbsp;\<%= f.text\_field :amount\_packages %\> &nbsp;&nbsp;\</p\> &nbsp;&nbsp;\<p\>\<%= f.submit "Submit" %\>\</p\> \<% end %\>

problem: leaving the as "problem" commented lines out, im lossing my "parent\_id", since it doesnt get posted. (this happens all in the EDIT-view). now is this correct or am i doing something wrong? thx tom
