1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-04 13:05:19 +02:00

Don’t render a select input for parent categories

This commit is contained in:
Elvis Serrão 2025-01-28 14:05:45 -03:00
parent 79ed958f64
commit 62d6efcb93

View file

@ -34,9 +34,8 @@
<div class="space-y-2">
<%= f.select :classification, [["Income", "income"], ["Expense", "expense"]], { label: "Classification" }, required: true %>
<%= f.text_field :name, placeholder: t(".placeholder"), required: true, autofocus: true, label: "Name", data: { color_avatar_target: "name" } %>
<% unless category.parent? %>
<%= f.select :parent_id, categories.pluck(:name, :id), { include_blank: "(unassigned)", label: "Parent category (optional)" }, disabled: category.parent? %>
<% if category.parent? %>
<span class="text-xs italic pl-2 text-gray-500">This category couldnt be assigned as a subcategory because it already has subcategories.</span>
<% end %>
</div>
</section>