I noticed this weird behavior when I do the following:
<%= link_to(image_tag('some_image', class:"some_class", onclick:"someFunction(event)"),some_path) %>
later calling event.target; returns undefined. I investigated this and it is because the event is the image_tag instead of the link_to.
so I guess my question is: why does this happen and how do I prevent it?
I ended up splitting the link and the image and putting the onclick on the link_to (the image is obviously not clickable and there's this ugly button under it, just curious if there is a way around this.
Thanks in advance!