创建Rails提交相关记录的表单

时间:2011-12-29 11:28:10

标签: ruby-on-rails activerecord ruby-on-rails-3.1

我有待售的发票清单(型号:发票)。对于每张发票(查看:索引),我希望人们能够通过提交表单为发票提供报价(型号:报价)。如何为每张发票创建表单以进行报价?

<% @invoices.each do |invoice| %>      
    # put a form for each invoice to create a new invoice.offer 
<% end %>