Skip to content

Commit

Permalink
Merge pull request #207 from flavio-b/patch-1
Browse files Browse the repository at this point in the history
Clarify `data-turbo-method` is needed for `data-turbo-confirm` on links
  • Loading branch information
dhh authored Oct 5, 2024
2 parents f79e305 + 5e35da6 commit ac8afc2
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 ac8afc2

Please sign in to comment.