Closed vamsipavanmahesh closed 8 years ago
The way this works with jquery-ujs
is to hook into the confirm
event, run our code, then afterwards hopefully reset to what was there originally - in your case Rails' trickery, to allow the delete action to be called:
Check that you have jquery-ujs
before data-confirm-modal
in your application.js, otherwise yes it's a bug :D
I just tested it, I have the following and it works correctly:
= link_to secrect_action_foo_path(@foo), method: :post, class: 'btn btn-default', data: { confirm: t('.secrect_action_confirm') } do
= t('.secret_action')
Check the order of files in your application.js, it should be:
The url went like this http://localhost:3000/cart/10fb416e-a97b-4cf6-9501-fd4417669b2b
//= require data-confirm-modal if i remove this line, everything works fine.