Closed bbugh closed 4 years ago
I think we'd strongly consider a PR for this. I think it's a good idea, and I'm curious how you'd suggest implementing it.
Even if this feature doesn't come to pass, I would strongly suggest that we raise a better exception message if they call it with the wrong number of parameters.
Feature Request
Is your feature request related to a problem?
Turbolinks doesn't currently handle get requests from forms (https://github.com/turbolinks/turbolinks/issues/272). StimulusReflex handles this perfectly without the hacky workarounds, except that the
stimulate
JavaScript function requires a reflex target, but the Ruby side doesn't need to do anything except refresh the page.In our specific case, have a
get
method search form. When the user clicks the search button, we usehistory.pushState
to update the search query in the URL. Our users like to bookmark searches, so we need to be able to write real URLs instead of using session values.We then call
stimulate
which rewrites the page. This works great, except in this case we've had to provide an empty Reflex target method.Describe the solution you'd like
stimulate
can take no arguments and still work as expected, re-rendering the current controller action and view.Additional context
Calling
stimulate
with no options currently raises this error: