Invoice system

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