I have one select box
<%=simple_form_for order_item do |oi|%>
<%= order_item.association :category, label: false, collection: current_company.categories, placeholder: 'Category', input_html: { class: 'form-control form-control-sm drop_down_input order_item_category} %>
<%end%>
and this select box is bind with select2
currently, when I search anything this shows results like this: -
But I want to results like show search and with a label that showing item's parent (note: - category has one parent. and one category has many children)
however I tried with option_groups with this the issue is I cant select option_group(which is parent), but I want to select all category.
Category model
belongs_to :parent, class: 'category', foreign_key: 'parent_id'
has_many :children, class: 'category'
Any help would be appreciated. thanks.

