<% checkboxes = [ { name: 'Coffee', id: 'coffee', checked: false }, { name: 'Ice Cream', id: 'ice-cream', checked: false }, { name: 'Chocolate', id: 'chocolate', checked: true } ] %> <%= pb_rails("table", props: { container: false, size: "md" }) do %> <%= pb_rails("checkbox", props: { checked: true, text: "Uncheck All", value: "checkbox-value", name: "main-checkbox", indeterminate: true, id: "indeterminate-checkbox" }) %> <% checkboxes.each do |checkbox| %> <%= pb_rails("checkbox", props: { checked: checkbox[:checked], text: checkbox[:name], value: checkbox[:id], name: "#{checkbox[:id]}-indeterminate-checkbox", id: "#{checkbox[:id]}-indeterminate-checkbox", }) %> <% end %> <% end %>