codevise / activeadmin-searchable_select

Searchable select boxes for forms and filters
Other
97 stars 33 forks source link

Set default values while loading the page #36

Closed anson2590 closed 2 years ago

anson2590 commented 3 years ago

Hi, while loading the page by default I need some values to be selected in the searchable select field, and is it possible to dynamically load data to drop down. Can you please guide me on how to achieve it?

tf commented 2 years ago

Sorry for being super late to respond. Setting defaults should work exactly the same as for normal select inputs. You will need to set the value on the model object used in the form.

Feel free to open another issue with a more specific question regarding loading data to help us improve the README.