x
1
2
3
4
5
6
7
8
9
10
<div class="space-y-4" x-data x-init="Alpine.store('favorite_fruits', '');"> <label class="label block " for="form_component_preview_test_model_favorite_fruits">Favorite fruits</label> <select x-model="$store.favorite_fruits" name="form_component_preview_test_model[favorite_fruits]" id="form_component_preview_test_model_favorite_fruits"><option value="">- Select -</option> <option value="orange">Orange</option> <option value="banana">Banana</option> <option value="apple">Apple</option></select> <p class="form_errors"> ⚠️ Favorite fruits can't be blank </p></div>1
2
3
custom_model = TestModel.newcustom_model.valid?render(DropdownComponent.new(form: form(model: custom_model), method: :favorite_fruits, label: I18n.t(:favorite_fruits), collection: self.class.fruit_options, item_value_method: :value, item_label_method: :label))No notes provided.
No params configured.