Search autocomplete with Stimulus and Rails

Hey All! I’ve created a simple search autocomplete example with Stimulus and Rails 5.2.

Please check it on GitHub and let me know if you have any questions: https://github.com/mrhead/stimulus-search

7 Likes

Very nice work! I’ll soon be adding some autocomplete fields to a new Rails 5.2 + Stimulus project I’m working on, so I may very well crib from your example. :slight_smile:

1 Like

Hey All,

I just did a few updates to the example app. You can see them in the following commits:

2 Likes

I used datalist / option (can even have some kind of optgroup with option value / innerText. and it works quite well but probably not as well everywhere : )

Stimulus search now uses Stimulus 2.0: https://github.com/mrhead/stimulus-search/pull/53

:tada:

3 Likes

Now bundled with jsbundling-rails and running on Stimulus 3.

2 Likes

This example now finally uses the Outlets API:

1 Like

Great reference. Thank you

1 Like