Search code examples
simple-form

simple_form - change association legend text


If I have a simple_form association (as: :checkboxes), how can I customize the text that appears inside the legend tag?


Solution

  • I discovered how, with some help from 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 %>