This is a Stimulus controller which will allow a Shoelace Form component to be processed and submitted by Turbo.
Just wrap your <sl-form> control with a form tag:
<%= form_with url: "/test-submit" do %>
  <sl-form data-controller="shoelace-form">
    controls go here
  </sl-form>
<% end %>This gist includes a Ruby variant and an ES variant, because I wrote the controller using Ruby2JS. You can use the ES variant if you don't have Ruby2JS (it is the direct transpiled output from Ruby2JS).
If you're using Ruby2JS + the Webpack loader, you can just drop the Ruby controller into your project under app/javascript/controllers.
Make sure you have the Stimulus autoimport configured in your rb2js.config.rb file:
    def self.options
      {
        eslevel: 2021,
        include: :class,
        underscored_private: true,
        autoimports: {
          [:Controller] => "stimulus",
        }
      }
    endAlso make sure you've updated your Stimulus controller context to load Ruby2JS files in app/javascript/controllers/index.js:
const context = require.context("controllers", true, /_controller\.js(\.rb)?$/)
Typescript version: