DEV Community

Discussion on: Instant search with Rails 6 and Hotwire

Collapse
 
davidcolbyatx profile image
David Colby • Edited

Great question! If you're not using ujs, you can replace Rails.fire(this.formTarget, 'submit') with this.formTarget.requestSubmit(). I haven't thoroughly tested that change but it should work okay.

You might want to consider a polyfill, since requestSubmit() isn't supported on IE and Safari yet: caniuse.com/mdn-api_htmlformelemen...

To replace rails/ujs, you can consider mrujs, but mrujs doesn't currently support Rails.fire

Collapse
 
halfbloody profile image
Jens

Apparently, the polyfill for requestSubmit is part of Turbo now, so no reason to worry: github.com/hotwired/turbo/pull/439