Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
turbo
The speed of a single-page web application without having to write any JavaScript (by hotwired)
-
pg_search
pg_search builds ActiveRecord named scopes that take advantage of PostgreSQL’s full text search
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
You can find the complete code for this guide on Github.
You can read more about the reasons for this behavior, and find possible workarounds, on Github.
When Turbo sees a response with the turbo-stream header and a turbo-stream wrapped HTML fragment, it reads the action and the target or, newly added, targets from the and uses that to update only the relevant part(s) of the DOM.
Cleaner, more performant database queries: Definitely don't just leave your query sitting in the controller! For production use cases, you'd want to consider an option like pg_search
Last year I wrote an article on building an instant search form with Rails and StimulusJS. Since then, Turbo, the other half of Hotwire for the web has been released. Turbo opens the door for an even simpler, cleaner implementation of an instant search form.