Rails为分组选择输入标题

我正在用简单的表单填充具有类别和子类别的分组选择输入:

 @categories = Category.where(ancestry: nil).order('name ASC')

<%= form.input :category,collection: @categories,as: :grouped_select,group_method: :children,label: false,include_blank: true,input_html: {} %>

当我保存一个类别和子类别时,我将其转换为小写格式。我的问题是,如何在集合选择输入中为上面的categories加上标题?

lufangfeiok 回答:Rails为分组选择输入标题

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2480486.html

大家都在问