Turbolinks causes a link with href="#" to trigger page refresh
The above solution didn't work for me but this did :
<a href="#" data-turbolinks="false">My link</a>
This can be found at https://github.com/turbolinks/turbolinks
update: This solution works for turbolinks 5, for classic turbolinks check the previous answer by @wael34218
Use data-no-turbolink
attribute on that link the error should be gone
<a href="#" data-no-turbolink>My link</a>