[#4181] Hooked up the Edit and Update actions for FixedDeliverables.

This commit is contained in:
Eric Davis
2010-06-23 17:05:28 -07:00
parent 32f91e8da2
commit 2ce9c55239
5 changed files with 53 additions and 3 deletions
@@ -16,6 +16,12 @@ class DeliverablesController < InheritedResources::Base
create! { contract_url(@project, @contract) }
end
def update
@deliverable = begin_of_association_chain.deliverables.find_by_id(params[:id])
@deliverable.attributes = params[:fixed_deliverable] # TODO: hardcoded
update! { contract_url(@project, @contract) }
end
def show
redirect_to contract_url(@project, @contract)
end
+2 -2
View File
@@ -31,7 +31,7 @@
<th><%= l(:field_labor) %></th>
<th><%= l(:field_overhead) %></th>
<th><%= l(:field_fixed) %></th>
<th>&nbsp;</th>
<th><%= l(:button_edit) %></th>
<th><%= l(:button_delete) %></th>
</thead>
<tbody>
@@ -46,7 +46,7 @@
<td class="labor">---</td>
<td class="overhead">---</td>
<td class="fixed">---</td>
<td>&nbsp;</td>
<td><%= link_to(l(:button_edit), edit_contract_deliverable_path(@project, resource, deliverable), :class => 'icon icon-edit') %></td>
<td><%= link_to(l(:button_delete), contract_deliverable_path(@project, resource, deliverable), :method => :delete, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %></td>
<% end %>
+9
View File
@@ -0,0 +1,9 @@
<%= content_tag(:h2, h(resource.title)) %>
<% semantic_form_for [@project, @contract, resource], :url => contract_deliverable_path(@project, @contract, resource), :html => {:class => 'tabular'} do |form| %>
<%= render :partial => 'form', :object => form, :locals => {:cancel_path => contract_path(@project, resource)} %>
<% end %>
<% content_for(:header_tags) do %>
<%= stylesheet_link_tag "redmine_contracts", :plugin => "redmine_contracts", :media => "screen" %>
<% end %>