From 79ed958f6467a6a49dd9376db26d14a36331f020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elvis=20Serr=C3=A3o?= Date: Tue, 28 Jan 2025 13:31:28 -0300 Subject: [PATCH] Add info about the disabled select --- app/views/categories/_form.html.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/categories/_form.html.erb b/app/views/categories/_form.html.erb index 06426988..dbfd76ae 100644 --- a/app/views/categories/_form.html.erb +++ b/app/views/categories/_form.html.erb @@ -35,6 +35,9 @@ <%= 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" } %> <%= f.select :parent_id, categories.pluck(:name, :id), { include_blank: "(unassigned)", label: "Parent category (optional)" }, disabled: category.parent? %> + <% if category.parent? %> + This category couldn’t be assigned as a subcategory because it already has subcategories. + <% end %>