From 62d6efcb931e7dfbeefabd1e0bb17ccc90bd09cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elvis=20Serr=C3=A3o?= Date: Tue, 28 Jan 2025 14:05:45 -0300 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20render=20a=20select=20input=20f?= =?UTF-8?q?or=20parent=20categories?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/categories/_form.html.erb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/categories/_form.html.erb b/app/views/categories/_form.html.erb index dbfd76ae..7117a3bf 100644 --- a/app/views/categories/_form.html.erb +++ b/app/views/categories/_form.html.erb @@ -34,9 +34,8 @@
<%= 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. + <% unless category.parent? %> + <%= f.select :parent_id, categories.pluck(:name, :id), { include_blank: "(unassigned)", label: "Parent category (optional)" }, disabled: category.parent? %> <% end %>