mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-28 17:49:38 +02:00
Fix budget edit button
This commit is contained in:
parent
e1d3c7a4a1
commit
60f1a1e2d2
2 changed files with 6 additions and 4 deletions
|
@ -139,7 +139,7 @@ class Budget < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def allocated_percent
|
def allocated_percent
|
||||||
return 0 unless budgeted_spending > 0
|
return 0 unless budgeted_spending && budgeted_spending > 0
|
||||||
|
|
||||||
(allocated_spending / budgeted_spending.to_f) * 100
|
(allocated_spending / budgeted_spending.to_f) * 100
|
||||||
end
|
end
|
||||||
|
|
|
@ -53,9 +53,11 @@
|
||||||
<div class="flex items-center justify-between mb-4">
|
<div class="flex items-center justify-between mb-4">
|
||||||
<h2 class="text-lg font-medium">Categories</h2>
|
<h2 class="text-lg font-medium">Categories</h2>
|
||||||
|
|
||||||
<%= link_to budget_budget_categories_path(@budget), class: "btn btn--secondary flex items-center gap-2" do %>
|
<% if @budget.initialized? %>
|
||||||
<%= icon "settings-2", color: "gray" %>
|
<%= link_to budget_budget_categories_path(@budget), class: "btn btn--secondary flex items-center gap-2" do %>
|
||||||
<span>Edit</span>
|
<%= icon "settings-2", color: "gray" %>
|
||||||
|
<span>Edit</span>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue