Confirm
A dialog in place of window.confirm for data-turbo-confirm. data-turbo-confirm-title, -accept and -variant="danger" customise it, and confirm_dialog_template carries its words through I18n.
Danger
A custom accept label and the danger variant, for an action that destroys something.
This example talks to a server
These are static pages, so what this example saves, posts or searches for won't answer here. Run the browser
(
bin/dev) or mount it in an app to try it for real.
<%= button_to "Reset profile", profile_dialog_path, method: :delete, class: button_classes(:danger),
form: { data: { turbo_confirm: "Reset the profile to its defaults?",
turbo_confirm_accept: "Reset", turbo_confirm_variant: "danger" } } %>Plain
Only data-turbo-confirm, so the dialog uses its default title and buttons.
This example talks to a server
These are static pages, so what this example saves, posts or searches for won't answer here. Run the browser
(
bin/dev) or mount it in an app to try it for real.
<%= button_to "Reset profile", profile_dialog_path, method: :delete, class: button_classes,
form: { data: { turbo_confirm: "Reset the profile?" } } %>