From 605a0e3420b3eff223f2efb89bff0a9d0e4c735e Mon Sep 17 00:00:00 2001 From: Marc Antwertinger Date: Thu, 6 Nov 2025 11:49:22 +0100 Subject: [PATCH 1/2] Document multiple selection option for Select ingredient Add documentation for the new multiple: true setting that allows users to select multiple values from a Select ingredient. --- guides/ingredients.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/guides/ingredients.md b/guides/ingredients.md index d5ec9e9..02e5f74 100644 --- a/guides/ingredients.md +++ b/guides/ingredients.md @@ -225,7 +225,7 @@ Stores a `Boolean` value in the database. Renders a checkbox in the editor parti ## Select -Renders a select box in the editor partial and stores the value as `String`. +Renders a select box in the editor partial and stores the value as `String`. When configured for multiple selection, it stores the values as an `Array`. Useful for letting your user select from a limited set of choices. @@ -235,8 +235,14 @@ Useful for letting your user select from a limited set of choices. A list of values your users can select from. Use [a two dimensional array](https://guides.rubyonrails.org/form_helpers.html#the-select-and-option-tags) for having value and text pairs. +* **multiple** `Boolean` (default: false) + + If set to `true`, the user can select multiple values from the list. The selected values will be stored as an `Array` instead of a single `String`. + ### Example +Single selection (default): + ~~~ yaml - name: width type: Select @@ -244,6 +250,16 @@ Useful for letting your user select from a limited set of choices. select_values: ['200', '300', '400'] ~~~ +Multiple selection: + +~~~ yaml +- name: categories + type: Select + settings: + select_values: ['Technology', 'Design', 'Marketing', 'Sales'] + multiple: true +~~~ + ::: tip If you need dynamic values (ie, a from a product catalogue), please [create a custom ingredient class](how_to_create_custom_ingredients) that provides the values. ::: From ded3b34d77ecbe325b7ac38d4d018107b0657e75 Mon Sep 17 00:00:00 2001 From: Marc Antwertinger Date: Thu, 6 Nov 2025 18:13:50 +0100 Subject: [PATCH 2/2] Document default value option for Select ingredient --- guides/ingredients.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/guides/ingredients.md b/guides/ingredients.md index 02e5f74..0ae8fee 100644 --- a/guides/ingredients.md +++ b/guides/ingredients.md @@ -239,6 +239,10 @@ Useful for letting your user select from a limited set of choices. If set to `true`, the user can select multiple values from the list. The selected values will be stored as an `Array` instead of a single `String`. +* **default** `String` (optional) + + A default value to prefill newly created elements. The value must be one of the values from `select_values`. + ### Example Single selection (default): @@ -248,6 +252,7 @@ Single selection (default): type: Select settings: select_values: ['200', '300', '400'] + default: '300' ~~~ Multiple selection: