I would like to invoke a javascript function (without JQuery) when the onclick even fires from a link_to tag in haml. How can I do this?
Here’s how to do it using Rails link_to in haml:
= link_to "my link", "", :onclick => "my_function(); return false"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With