Topic: Passing arguments
I have an application that I'm working on where I have an invoice page that can have multiple line items.
Creating the invoice page is done, but now I want to add the line items. The work flow goes:
Create the new invoice, and then click on the Add Line Item link. This is what I have in the edit.rhtml for editing the invoice (where I want the user to click for adding line items):
<%= link_to 'Add Line Item', :action => 'new_item', :id => @invoice %>
I have a view and controller for adding the line item, and saving it to the row to the line item table, but I am having trouble figuring out how to know what the invoice id is. In the above link the invoice id is appended to the end of the URL for adding the line item, how do I access that in either controller when I'm saving the line item?
Thanks for any assistance.