INVOICE フォームがあります。入力の手間を省くために、ユーザーは請求書の属性を入力し、ボタンをクリックして最初のレコードをコピーし、いくつかの属性を変更してから、すべてのレコードを一度に保存する必要があります。エクセル風。ヘルプ?
<% form_for @invoice, :html => { :multipart => true } do |f| %>
<%= f.error_messages %>
<table class="ExcelTable2007">
<tr>
<th class="heading">PO #<font color="red"> *</font></th>
<th class="heading">Invoice #</th>
<th class="heading">"Bill To" is Correct</th>
<th class="heading">Invoice Date</th>
<th class="heading">Date Received</th>
<th class="heading">AP Clerk Note</th>
<th class="heading">Division</th>
<th class="heading">GR Approver</th>
<th class="heading">GR Alternate Approver</th>
<th class="heading">Invoice Attachment</th>
</tr>
<tr>
<td class="heading"><%= f.text_field :po_number, :size => 10 %></td>
<td class="heading"><%= f.text_field :invoice_number, :size => 10 %></td>
<td class="heading"><%= f.check_box :bill_to_address %></td>
<td class="heading"><%= f.calendar_date_select "invoice_date", :time => false, :size => 12 %></td>
<td class="heading"><%= f.calendar_date_select "date_received", :time => false, :size => 12 %></td>
<td class="heading"><%= f.text_field :clerk_note %></td>
<td class="heading"><%= f.collection_select :division_id, Division.active.order(:division), :id, :division, :include_blank => true %></td>
<td class="heading"><%= f.collection_select :approver_username, Aduser.order(:last_name, :first_name), :username, :fullname, :include_blank => true %></td>
<td class="heading"><%= f.collection_select :alternate_approver_username, Aduser.order(:last_name, :first_name), :username, :fullname, :include_blank => true %></td>
<td class="heading"><%= f.file_field :attachment %></td>
</tr>
</p>
</table>
    <%= link_to "Add Invoice", clone_invoice_url(@invoice) %>
<br>
<br>
<div class="actions">
<%= f.submit "Submit" %>
</div>
</p>
<% end %>
次のことを試しましたが、無効な認証トークンを受け取りました:
def clone_invoice
@invoice = Invoice.find(params[:id]).dup
@invoice.save
end
誰でも私を助けることができますか?前もって感謝します!