simple_form - 更改关联图例文本

simple_form - change association legend text

如果我有一个 simple_form 关联 (as: :checkboxes),我如何自定义出现在 legend 标签内的文本?

this answer 的帮助下,我发现了方法。

  <%= f.association :inventory_sublocations,
    collection: location.inventory_sublocations,
    label: 'my custom label', # "my custom label" will appear inside the legend tag
    as: :check_boxes %>