diff --git a/app/components/users/budget_investment_table_actions_component.html.erb b/app/components/users/budget_investment_table_actions_component.html.erb
index ea9290bcd..a29abf847 100644
--- a/app/components/users/budget_investment_table_actions_component.html.erb
+++ b/app/components/users/budget_investment_table_actions_component.html.erb
@@ -1,11 +1,9 @@
<% if can? :update, investment %>
- <%= link_to t("shared.edit"), edit_budget_investment_path(investment.budget, investment),
- class: "button hollow" %>
+ <%= edit_link %>
<% end %>
+
<% if can? :destroy, investment %>
- <%= button_to t("shared.delete"), budget_investment_path(investment.budget, investment),
- method: :delete, class: "button hollow alert",
- data: { confirm: t("users.show.delete_alert") } %>
+ <%= destroy_button %>
<% end %>
diff --git a/app/components/users/budget_investment_table_actions_component.rb b/app/components/users/budget_investment_table_actions_component.rb
index 9628a4383..8a12a4e33 100644
--- a/app/components/users/budget_investment_table_actions_component.rb
+++ b/app/components/users/budget_investment_table_actions_component.rb
@@ -5,4 +5,20 @@ class Users::BudgetInvestmentTableActionsComponent < ApplicationComponent
def initialize(investment)
@investment = investment
end
+
+ private
+
+ def edit_link
+ link_to t("shared.edit"),
+ edit_budget_investment_path(investment.budget, investment),
+ class: "button hollow"
+ end
+
+ def destroy_button
+ button_to t("shared.delete"),
+ budget_investment_path(investment.budget, investment),
+ method: :delete,
+ class: "button hollow alert",
+ data: { confirm: t("users.show.delete_alert") }
+ end
end