[#6574] Allow removing labor budgets

This commit is contained in:
Eric Davis
2011-10-11 11:44:16 -07:00
parent 7d0abc641a
commit d633b32b30
3 changed files with 20 additions and 5 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ class Deliverable < ActiveRecord::Base
has_many :fixed_budgets
has_many :issues, :dependent => :nullify
accepts_nested_attributes_for :labor_budgets
accepts_nested_attributes_for :labor_budgets, :allow_destroy => true
accepts_nested_attributes_for :overhead_budgets
accepts_nested_attributes_for :fixed_budgets
@@ -1,5 +1,6 @@
<tr>
<tr class="labor-budget-form">
<td>
<%= labor_budget.hidden_field(:id) unless labor_budget.object.new_record? %>
<%= labor_budget.hidden_field(:year) %>
<%= labor_budget.hidden_field(:month) %>
@@ -15,6 +16,8 @@
<%= labor_budget.text_field(:budget, :value => format_deliverable_value_fields(labor_budget.object.budget), :class => 'financial') %>
</td>
<td class="add-labor">
<%= labor_budget.hidden_field "_destroy", :class=> "delete-flag" %>
<%= link_to_function("Remove", 'deleteDeliverableFinance(this)', :class => 'delete icon icon-del') %>
<%= link_to_function("Add", 'addNewDeliverableFinance("labor")', :class => 'add icon icon-add', :style => 'display:none;') %>
</td>
</tr>