Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.3K
Visualizações
Ruby on Rails guide DELETE section not working
<%= link_to "Destroy", article_path(@article), data: {
                turbo_method: :delete,
                turbo_confirm: "Are you sure?"
              } %>

This is listed on the official website of Ruby on Rails as a simple way of deleting an Active Record. I have the same controller method as they do. This does not delete, nor does it confirm. I have found other methods that successfully delete, but none that confirm. I would like to understand why this doesn't delete, and how I can confirm.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

This SO post addresses a similar problem and answered by @json fb. Quoting statements from the SO post

This happens if you had locally installed gem versions 7.1.0 or 7.1.1 for turbo-rails

These gem numbers were pushed by accident to Rubygems in October, then yanked. However, since bundler will default to the highest number of your Rails gem when it sets up your new rails app, it will pick turbo-rails version 7.1.0 or 7.1.1 , which will display this flaw

The gems were yanked, so this only affects you if you were developing rails apps between October 2021 and the yank date. TO FIX YOUR COMPUTER: gem uninstall turbo-rails

over 4 years ago · Santiago Trujillo Relatório

0

<ul>
<li><%= link_to "Edit", edit_article_url(@article) %> </li>
<li><%= button_to "Destroy", article_path(@article), method: :delete,
            data: { method_turbo_confirm: "Are you sure?" }
 %></li>

Changing link_to to button_to and adding method: :delete worked for me. Although the "Are you sure?" pop up is still not working.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda