Closed smptmhr closed 2 years ago
$bundle add importmap-rails
$rails importmap:install
gem 'turbo-rails'
$bundle install
$rails turbo:install
<%= button_to "タスクを削除", @task, method: :delete,form: {data: {turbo_confirm: "本当に削除しますか?"} } %>
参考 : How to call confirm prompt using button_to in Rails with Turbo https://github.com/hotwired/turbo-rails https://github.com/rails/importmap-rails
問題
rails new
をするときに--minimal
オプションを使用したので、data-confirmを呼び出すためのgemがインストールされていない。やること