I\'m having trouble using the event.preventDefault();
for an ahref
on my DOM.
How do you prevent the url from posting a nofollow delete, as spe
It's an old question, but if you are using Rails 5.1+ with the vanilla UJS instead of jQuery one, neither event.preventDefault()
nor returning false
from the method stops rails-ujs from handling it. You need to explicitly call Rails.stopEverything(event)
$('.trash_can a').click(function(event) {
Rails.stopEverything(event);
console.log('Clicked Delete');
});