I have a data-confirm
attribute on a button, but I only want the alert to show if a certain condition (on the client-side) is met. Does anyone know a way to do this cleanly?
I found this: clean way to make the "confirm" conditional in rails 4
...but that is only for a server-side conditional.