Make sure javascript click can work on nomal link
http://rors.org/demos/custom-confirm-in-rails
This is a great alternative for javascript confirm box. But I do have issue on simple anchor links with 'data-confirm' attribute set. User won't be able to redirected to the new page even confirm button has been clicked, you have to click again.
The workaround is to make sure 'data-method' of the anchor has been set, to "get" for a normal link.
Written by Leon Guan
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#