import { Controller } from "@hotwired/stimulus"
 
export default class extends Controller {
 
  search() {
    clearTimeout(this.timeout)
    this.timeout = setTimeout(() => {
      this.element.requestSubmit()
    }, 200)
  }
}
= form_with(url: cats_path, method: :get, data: { controller: "form-submission", turbo_frame: "cats", turbo_action: "advance" }) do |form|
  = form.label :query, "Search by name:"
  = form.text_field :query, data: { action: "input->form-submission#search" }