# Invoice system

**URL:** <https://www.ruby-forum.com/t/invoice-system/111924>\
**Category:** Rails\
**Created:** [August 13, 2007, 3:49pm UTC](https://www.ruby-forum.com/t/invoice-system/111924 "2007-08-13T15:49:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![janc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7bcc69/32.png) [@janc](https://www.ruby-forum.com/u/janc)\
**Post date:** [August 13, 2007, 3:49pm UTC](https://www.ruby-forum.com/t/invoice-system/111924/1 "2007-08-13T15:49:35Z")

</div>

Hi,

I wanna make a invoice system. I’ve set up a invoice model and a  
invoice\_item model (invoice has\_many invoice\_item and invoice\_item  
belongs\_to invoice). Also invoice belongs\_to a customer, and a customer  
has\_many invoice.

My problem is i don’t know how to create the form for making a new  
invoice. I’ve made a similar system in php, and here is how the html  
form was:

Then i made 10 text fields:

I know something similar can be done in RoR, but just how i don’t know.  
My question then is:

How can i make the form, so when the invoice is saved, it goes through  
all the invoice\_item text fields and adds them to the database - with  
the right invoice\_id?

Best Regards Jan Christensen
