From ff6e12dc7f5579a02f63fdf89914daf34a407387 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Fri, 17 Nov 2023 14:23:30 -0500 Subject: [PATCH] add notes about ignored paths (related to hotwired/turbo#1070) --- _source/handbook/02_drive.md | 18 ++++++++++++++++++ _source/reference/attributes.md | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/_source/handbook/02_drive.md b/_source/handbook/02_drive.md index 5417c9e..6d24784 100644 --- a/_source/handbook/02_drive.md +++ b/_source/handbook/02_drive.md @@ -311,4 +311,22 @@ Preload links into Turbo Drive's cache using `Hom This will make page transitions feel lightning fast by providing a preview of a page even before the first visit. Use it to preload the most important pages in your application. Avoid over usage, as it will lead to loading content that is not needed. It also dovetails nicely with pages that leverage [Eager-Loading Frames](/reference/frames#eager-loaded-frame) or [Lazy-Loading Frames](/reference/frames#lazy-loaded-frame). As you can preload the structure of the page and show the user a meaningful loading state while the interesting content loads. + +## Ignored Paths + +Paths with a `.` in the URL will not be handled by Turbo. Turbo will ignore forms and links that target these paths. For example, the following forms would be ignored: + +```html +
+ +
+ + +
+ +
+``` + +Setting any `data-turbo` methods (including `data-turbo="true"`) will not override or force Turbo to handle a path if it has a `.` in the URL. Paths with a `.` should be reworked on the backend to not include one. Note that some backend frameworks (i.e. Rails) may automatically append parameters/IDs with a `.` such as `/my_path.67`. +

diff --git a/_source/reference/attributes.md b/_source/reference/attributes.md index 9034a7b..7665ca9 100644 --- a/_source/reference/attributes.md +++ b/_source/reference/attributes.md @@ -11,7 +11,7 @@ description: "A reference of everything you can do with element attributes and m The following data attributes can be applied to elements to customize Turbo's behaviour. -* `data-turbo="false"` disables Turbo Drive on links and forms including descendants. To reenable when an ancestor has opted out, use `data-turbo="true"`. Be careful: when Turbo Drive is disabled, browsers treat link clicks as normal, but [native adapters](/handbook/native) may exit the app. +* `data-turbo="false"` disables Turbo Drive on links and forms including descendants. To reenable when an ancestor has opted out, use `data-turbo="true"`. Be careful: when Turbo Drive is disabled, browsers treat link clicks as normal, but [native adapters](/handbook/native) may exit the app. Note that if Turbo [ignores a path](/handbook/drive#ignored-paths), then setting `data-turbo="true"` will not force/override it to enable. * `data-turbo-track="reload"` tracks the element's HTML and performs a full page reload when it changes. Typically used to [keep `script` and CSS `link` elements up-to-date](/handbook/drive#reloading-when-assets-change). * `data-turbo-frame` identifies the Turbo Frame to navigate. Refer to the [Frames documentation](/reference/frames) for further details. * `data-turbo-action` customizes the [Visit](/handbook/drive#page-navigation-basics) action. Valid values are `replace` or `advance`. Can also be used with Turbo Frames to [promote frame navigations to page visits](/handbook/frames#promoting-a-frame-navigation-to-a-page-visit).