Skip to content

Instantly share code, notes, and snippets.

@frankyston
Created November 5, 2022 13:05
Show Gist options
  • Save frankyston/97a368e513db03a7d3c9d99083e4461f to your computer and use it in GitHub Desktop.
Save frankyston/97a368e513db03a7d3c9d99083e4461f to your computer and use it in GitHub Desktop.

Comentar no admin.js o Turbo stream

// Turbo.session.drive = false

Colocar o data para usar o turbo stream

data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' }

Antes estava assim:

<%= button_to "Excluir", admin_category_path(category), method: :delete, class: 'btn btn-danger', data: {turbo: false} %>

e agora fica assim:

<%= link_to "Excluir", admin_category_path(category), method: :delete, class: 'btn btn-danger', data: { turbo_method: :delete, turbo_confirm: 'Deseja realmente excluir?' } %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment