Skip to content

Commit

Permalink
Mention that data-turbo-method is needed for data-turbo-confirm o…
Browse files Browse the repository at this point in the history
…n links

Small update to the example on how to use `data-turbo-confirm` with links.
  • Loading branch information
flavio-b authored Oct 4, 2024
1 parent f79e305 commit 5e35da6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _source/handbook/02_drive.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ You should also consider that for accessibility reasons, it's better to use actu

## Requiring Confirmation for a Visit

Decorate links with `data-turbo-confirm`, and confirmation will be required for a visit to proceed.
Decorate links with both `data-turbo-confirm` and `data-turbo-method`, and confirmation will be required for a visit to proceed.

```html
<a href="/articles" data-turbo-confirm="Do you want to leave this page?">Back to articles</a>
<a href="/articles" data-turbo-method="get" data-turbo-confirm="Do you want to leave this page?">Back to articles</a>
<a href="/articles/54" data-turbo-method="delete" data-turbo-confirm="Are you sure you want to delete the article?">Delete the article</a>
```

Expand Down

0 comments on commit 5e35da6

Please sign in to comment.