ifad / data-confirm-modal

Makes Rails' link_to confirm: 'foo' build a Bootstrap Modal instead of calling the browser's confirm() API.
MIT License
271 stars 115 forks source link

Duplicate alert rails 5 #50

Closed Mesnet closed 7 years ago

Mesnet commented 7 years ago

Hi guys, thanks for this gem I love it !! I've just updated to rails 5 and I'm encountering a problem since that. The template is working but when I click on continue, the default modal (not deigned) appear. So I have to click two times on validate. Someone has already had the same problem ?

haurbano commented 7 years ago

Hi @Mesnet, I have the same issue, do you found a solution? whether yes, plese tell me it! :D

mvdamme commented 7 years ago

Same problem here...

mvdamme commented 7 years ago

It turns out that data-confirm-modal is not adapted to the new rails-ujs used in Rails 5. I reverted to using jquery-ujs which fixed the problem (and since I'm using jQuery anyway it comes without overhead).

SunDi3yansyah commented 7 years ago

Yay!

application.js should be like this

//= require jquery
//= require jquery_ujs

maybe Rails > 5.1 because use rails-ujs

Thanks @mvdamme :+1:

CyberDeck commented 7 years ago

To get it working with rails-ujs for Rails 5.1, you can give it a try with my pull request #55.

vjt commented 7 years ago

Fixed in #55. Thanks everyone.