As of v7.1.0 form submissions do not use Turbo if the route includes a dot within its dynamic segment (https://guides.rubyonrails.org/routing.html#dynamic-segments)
For example, a form executing a POST to /domains/example.com
It looks as though the bug has been introduced as part of #437, which introduces an additional check for locationIsVisitable in this code:
|
willSubmitForm(form: HTMLFormElement, submitter?: HTMLElement): boolean { |
|
const action = getAction(form, submitter) |
|
|
|
return this.elementDriveEnabled(form) |
|
&& (!submitter || this.elementDriveEnabled(submitter)) |
|
&& locationIsVisitable(expandURL(action), this.snapshot.rootLocation) |
|
} |
which is defined here:
|
export function locationIsVisitable(location: URL, rootLocation: URL) { |
|
return isPrefixedBy(location, rootLocation) && isHTML(location) |
|
} |
and checks the extension on the URL:
|
export function isHTML(url: URL) { |
|
return !!getExtension(url).match(/^(?:|\.(?:htm|html|xhtml))$/) |
|
} |
As of v7.1.0 form submissions do not use Turbo if the route includes a dot within its dynamic segment (https://guides.rubyonrails.org/routing.html#dynamic-segments)
For example, a form executing a POST to
/domains/example.comIt looks as though the bug has been introduced as part of #437, which introduces an additional check for
locationIsVisitablein this code:turbo/src/core/session.ts
Lines 202 to 208 in aa9724d
which is defined here:
turbo/src/core/url.ts
Lines 35 to 37 in 18c93e9
and checks the extension on the URL:
turbo/src/core/url.ts
Lines 26 to 28 in 18c93e9