title: How to make data:{confirm..} work in rails 6 | button_to
body: <p>my confirm popup not working in rails 6.
  I added gem 'jquery-rails' to GEMFILE and run bundle install. I also added</p>
  <pre><code>//= require jquery
  //= require jquery_ujs
  </code></pre>
  <p>this in application.js which is linked in layouts/application.html.erb as</p>
  <pre><code>&lt;%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %&gt;
  </code></pre>
  <p>Button working, and delete users, but there is not popup, where i can confirm, that i want to delete that user. What am i doing wrong?</p>
  <p>This is my code in dashboard.html.erb</p>
  <pre><code>&lt;%= button_to &quot;Delete account&quot;,
                              admin_dashboard2_path(currentUser.id),
                              method: :delete,
                              data: {confirm:'Are you sure?'},
                              class: 'btn btn-primary'
            %&gt;
  </code></pre>
  <p>This is code in browser:</p>
  <pre><code>&lt;form class=&quot;button_to&quot; method=&quot;post&quot; action=&quot;/ed-admin/39&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;delete&quot; /&gt;&lt;input data-confirm=&quot;Are you sure?&quot; class=&quot;btn btn-primary&quot; type=&quot;submit&quot; value=&quot;Delete account&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;authenticity_token&quot; value=&quot;WFyXCkE6r4vmcecfQF_ngWlHHU22bkKRLTT_cNeAC47szzjOd9JtuY_33L_4BUdWIcudhKRN0seWNO5QZ6MCfQ&quot; /&gt;&lt;/form&gt;```
  </code></pre>