Extract view into component
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("management.budgets.table_name") %></th>
|
||||
<th><%= t("management.budgets.table_phase") %></th>
|
||||
<th><%= t("management.budgets.table_actions") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr id="<%= dom_id(budget) %>">
|
||||
<td><%= budget.name %></td>
|
||||
<td><%= budget.current_phase.name %></td>
|
||||
<td align="right">
|
||||
<%= link_to t("management.budgets.print_investments"),
|
||||
print_management_budget_investments_path(budget) %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,7 @@
|
||||
class Management::Budgets::PrintInvestments::TableComponent < ApplicationComponent
|
||||
attr_reader :budget
|
||||
|
||||
def initialize(budget)
|
||||
@budget = budget
|
||||
end
|
||||
end
|
||||
@@ -1,21 +1,3 @@
|
||||
<h2><%= t("management.budgets.print_investments") %></h2>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("management.budgets.table_name") %></th>
|
||||
<th><%= t("management.budgets.table_phase") %></th>
|
||||
<th><%= t("management.budgets.table_actions") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr id="<%= dom_id(@budget) %>">
|
||||
<td><%= @budget.name %></td>
|
||||
<td><%= @budget.current_phase.name %></td>
|
||||
<td align="right">
|
||||
<%= link_to t("management.budgets.print_investments"),
|
||||
print_management_budget_investments_path(@budget) %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= render Management::Budgets::PrintInvestments::TableComponent.new(@budget) %>
|
||||
|
||||
Reference in New Issue
Block a user