# sniplets of the code "_item_list.html.erb"
<%= link_to_function "Add new Item" do |page|
claim_form.fields_for :items, Item.new, :child_index => 'NEW_RECORD' do |f|
html = render(:partial => "claims/item_list",
:locals => { :form => f })
page << "$$('tr.item').last().insert({ bottom: '#{escape_javascript(html)}'.replace(/NEW_RECORD/g, new Date().getTime()) });"
end
end%>
# when I click on the Add new Item button, I want it to create another