Building a modal form with Turbo Stream GET requests and custom stream actions · Colby.so
25-Sep-2022 962
Turbo 7.2 brought major changes to what you can accomplish with Turbo Streams. To demonstrate those changes, today we are going to build a Turbo Stream-powered modal form without a single Turbo Frame. We will also create our own custom Turbo Stream action that emits a custom event on the browser.The key technique we will use in this article is an update to the standard method of using Turbo to open and populate modals. Prior to Turbo 7.2, Turbo would not allow GET requests to respond directly with Turbo Streams. Smart folks devised a workaround to this limitation which involved using empty Turbo Frames to sneak in Turbo Stream actions. That workaround still works fine, but it is no longer necessary.
Building a modal form with Turbo Stream GET requests and custom stream actions · Colby.so #ruby #rubydeveloper #rubyonrails #Building #modal #Turbo #Stream #requests #custom #stream #actions #Colby.so #turbo https://rubyonrails.ba/link/building-a-modal-form-with-turbo-stream-get-requests-and-custom-stream-actions-colby-so