= invoice_form.fields_for :item_services do |item_fields|
= item_service.label ‘Search for services’
= item_service.text_field :description
= item_service.submit ‘Search’
= invoice_form.submit ‘Create Invoice’
The outer form is the last to be submitted(creates an Invoice) and in the meanwhile, in the inner form, I’d like to search for an Service and if it doesn’t exists, I’d be rendering some field to create a service and then keep going on the flow.
This is a many-to-many relationship
Invoice ->|--------------|<- ItemService
The outer form is the last to be submitted(creates an Invoice) and in
the
meanwhile, in the inner form, I'd like to search for an Service and if
it
doesn't exists, I'd be rendering some field to create a service and then
keep going on the flow.
This is a many-to-many relationship
*Invoice* ->|--------------|<- *ItemService*