Initially no confirm was coming up.
I found that adding //= query_ujs to my asset manifold resolved this.
However… now I find that the confirm dialog takes “2 clicks” to use (either the cancel or the ok buttons).
My manifest looks like this:
//= require jquery
//= require jquery-ui
//
// ujs needed for delete confirm dial boxes.
//= require jquery_ujs
Whether it’s cancel or OK, it takes two clicks.
The Rails code for the delete button
= button_to '', schedule_path(schedule),
:method => 'delete',
:confirm => 'Are you sure you want to delete this schedule?',
:class => 'deleteicon',
:title => "Delete #{name}"
Resulting HTML:
<form action="/schedule/719" class="button_to" method="post">
<div>
<input name="_method" value="delete" type="hidden">
<input class="deleteicon" data-confirm="Are you sure you want to delete this schedule?" title="Delete Shedule A" value="" type="submit">
<input name="authenticity_token" value="wpcofEiLu6NXymHj289XGahTTT1XqNI56XvBlAFq2G8=" type="hidden">
</div>
</form>
js for page header:
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery-ui.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>
The answer was asset compilation.
Our system is set to automatically compile assets during runtime.
I had (mistakenly) also done a
rake assets:precompileso I had basically duplicated the js and created the duplicate. I noticed at the time theta the precompile that it created a lot of files which was a red flag as to why things had changed and the double click had started (although when precompile is used, it has its place).Thanks to git I was able to revert to master, rebranch anew with a new branch name and just not do the precompile step.