Skip to content

Commit cbd793c

Browse files
committed
Allow empty parent for new category
Choosing empty parent category will create a root taxon and a new taxonomy record under the hood.
1 parent b1e8970 commit cbd793c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

admin/app/components/solidus_admin/products/show/categories/new/component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<%= form_for @taxon, url: solidus_admin.product_taxons_path(@product), method: :post, html: { id: dom_id(@taxon) } do |f| %>
44
<div class="flex flex-col gap-6 pb-4">
55
<%= render component("ui/forms/field").text_field(f, :name, class: "required") %>
6-
<%= render component("ui/forms/field").select(f, :parent_id, parent_taxon_options) %>
6+
<%= render component("ui/forms/field").select(f, :parent_id, parent_taxon_options, include_blank: t(".none")) %>
77
<%= render component("ui/forms/field").text_area(f, :description) %>
88
</div>
99
<% end %>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
en:
22
cancel: "Cancel"
3+
none: "None"
34
submit: "Add Category"
45
title: "New Category"

0 commit comments

Comments
 (0)