diff --git a/app/helpers/budget_investments_helper.rb b/app/helpers/budget_investments_helper.rb index e3f17601a..d0a01b6af 100644 --- a/app/helpers/budget_investments_helper.rb +++ b/app/helpers/budget_investments_helper.rb @@ -9,6 +9,11 @@ module BudgetInvestmentsHelper params.map { |af| t("admin.budget_investments.index.filters.#{af}") }.join(', ') end + def link_to_investments_sorted_by(column) + sorting_option = budget_investments_sorting_options.select { |so| so[1] == column.downcase }.flatten + link_to t(sorting_option[0]), admin_budget_budget_investments_path(sort_by: sorting_option[1]) + end + def investments_minimal_view_path budget_investments_path(id: @heading.group.to_param, heading_id: @heading.to_param, diff --git a/app/views/admin/budget_investments/_investments.html.erb b/app/views/admin/budget_investments/_investments.html.erb index d56cc65f8..9daef3ac3 100644 --- a/app/views/admin/budget_investments/_investments.html.erb +++ b/app/views/admin/budget_investments/_investments.html.erb @@ -35,9 +35,9 @@
| <%= link_to t("admin.budget_investments.index.list.id"), admin_budget_budget_investments_path(sort_by: "id") %> | -<%= link_to t("admin.budget_investments.index.list.title"), admin_budget_budget_investments_path(sort_by: "title") %> | -<%= link_to t("admin.budget_investments.index.list.supports"), admin_budget_budget_investments_path(sort_by: "supports") %> | +<%= link_to_investments_sorted_by t("admin.budget_investments.index.list.id") %> | +<%= link_to_investments_sorted_by t("admin.budget_investments.index.list.title") %> | +<%= link_to_investments_sorted_by t("admin.budget_investments.index.list.supports") %> | <%= t("admin.budget_investments.index.list.admin") %> | <%= t("admin.budget_investments.index.list.valuation_group") %> |
|---|