[#4177] Scope the finders on ContractsController to use the current project.
This commit is contained in:
1 parent
736f315b36
commit
793fe165c1
3 files changed
+32
-10
No files matched your search
@@ -6,6 +6,12 @@ class ContractsController < InheritedResources::Base
|
||||
before_filter :find_project
|
||||
before_filter :authorize
|
||||
|
||||
protected
|
||||
|
||||
def begin_of_association_chain
|
||||
@project
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def find_project
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
<tbody>
|
||||
<% collection.each do |contract| %>
|
||||
<% content_tag_for(:tr, contract) do %>
|
||||
<td><%= h contract.id %></td>
|
||||
<td><%= h contract.name %></td>
|
||||
<td><%= h contract.account_executive.name %></td>
|
||||
<td><%= h format_date(contract.end_date) %></td>
|
||||
<td class="id"><%= h contract.id %></td>
|
||||
<td class="name"><%= h contract.name %></td>
|
||||
<td class="account-executive"><%= h contract.account_executive.name %></td>
|
||||
<td class="end-date"><%= h format_date(contract.end_date) %></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
Reference in new issue
Block a user