changed id assignment to object assignment to circumvent 500 error if no cost types were defined yet.

git-svn-id: https://dev.finn.de/svn/cockpit/trunk@202 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
hjust 15 years ago
parent 4d86637597
commit 3c4d5f971b
  1. 2
      app/views/cost_objects/_form.rhtml

@ -20,7 +20,7 @@
<% if @cost_object.kind == "VariableCostObject" -%>
<script type="text/javascript">
//<![CDATA[
materialBudgetItemsForm = new Subform('<%= escape_javascript(render(:partial => "material_budget_item", :object => @cost_object.material_budget_items.build(:cost_type_id => CostType.default.id) )) %>',<%= @cost_object.material_budget_items.length %>,'material_budget_items_body');
materialBudgetItemsForm = new Subform('<%= escape_javascript(render(:partial => "material_budget_item", :object => @cost_object.material_budget_items.build(:cost_type => CostType.default) )) %>',<%= @cost_object.material_budget_items.length %>,'material_budget_items_body');
laborBudgetItemsForm = new Subform('<%= escape_javascript(render(:partial => "labor_budget_item", :object => @cost_object.labor_budget_items.build )) %>',<%= @cost_object.labor_budget_items.length %>,'labor_budget_items_body');
//]]>
</script>

Loading…
Cancel
Save